Class: Killbill::Plugin::Model::BlockingState

Inherits:
Object
  • Object
show all
Defined in:
lib/killbill/gen/api/blocking_state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBlockingState

Returns a new instance of BlockingState.



39
40
# File 'lib/killbill/gen/api/blocking_state.rb', line 39

def initialize()
end

Instance Attribute Details

#blocked_idObject

Returns the value of attribute blocked_id.



37
38
39
# File 'lib/killbill/gen/api/blocking_state.rb', line 37

def blocked_id
  @blocked_id
end

#created_dateObject

Returns the value of attribute created_date.



37
38
39
# File 'lib/killbill/gen/api/blocking_state.rb', line 37

def created_date
  @created_date
end

#descriptionObject

Returns the value of attribute description.



37
38
39
# File 'lib/killbill/gen/api/blocking_state.rb', line 37

def description
  @description
end

#effective_dateObject

Returns the value of attribute effective_date.



37
38
39
# File 'lib/killbill/gen/api/blocking_state.rb', line 37

def effective_date
  @effective_date
end

#idObject

Returns the value of attribute id.



37
38
39
# File 'lib/killbill/gen/api/blocking_state.rb', line 37

def id
  @id
end

#is_block_billingObject

Returns the value of attribute is_block_billing.



37
38
39
# File 'lib/killbill/gen/api/blocking_state.rb', line 37

def is_block_billing
  @is_block_billing
end

#is_block_changeObject

Returns the value of attribute is_block_change.



37
38
39
# File 'lib/killbill/gen/api/blocking_state.rb', line 37

def is_block_change
  @is_block_change
end

#is_block_entitlementObject

Returns the value of attribute is_block_entitlement.



37
38
39
# File 'lib/killbill/gen/api/blocking_state.rb', line 37

def is_block_entitlement
  @is_block_entitlement
end

#serviceObject

Returns the value of attribute service.



37
38
39
# File 'lib/killbill/gen/api/blocking_state.rb', line 37

def service
  @service
end

#state_nameObject

Returns the value of attribute state_name.



37
38
39
# File 'lib/killbill/gen/api/blocking_state.rb', line 37

def state_name
  @state_name
end

#typeObject

Returns the value of attribute type.



37
38
39
# File 'lib/killbill/gen/api/blocking_state.rb', line 37

def type
  @type
end

#updated_dateObject

Returns the value of attribute updated_date.



37
38
39
# File 'lib/killbill/gen/api/blocking_state.rb', line 37

def updated_date
  @updated_date
end

Instance Method Details

#to_javaObject



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/killbill/gen/api/blocking_state.rb', line 42

def to_java()
  # conversion for id [type = java.util.UUID]
  @id = java.util.UUID.fromString(@id.to_s) unless @id.nil?

  # conversion for created_date [type = org.joda.time.DateTime]
  if !@created_date.nil?
    @created_date =  (@created_date.kind_of? Time) ? DateTime.parse(@created_date.to_s) : @created_date
    @created_date = Java::org.joda.time.DateTime.new(@created_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
  end

  # conversion for updated_date [type = org.joda.time.DateTime]
  if !@updated_date.nil?
    @updated_date =  (@updated_date.kind_of? Time) ? DateTime.parse(@updated_date.to_s) : @updated_date
    @updated_date = Java::org.joda.time.DateTime.new(@updated_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
  end

  # conversion for blocked_id [type = java.util.UUID]
  @blocked_id = java.util.UUID.fromString(@blocked_id.to_s) unless @blocked_id.nil?

  # conversion for state_name [type = java.lang.String]
  @state_name = @state_name.to_s unless @state_name.nil?

  # conversion for type [type = org.killbill.billing.entitlement.api.BlockingStateType]
  @type = Java::org.killbill.billing.entitlement.api.BlockingStateType.value_of( @type.to_s ) unless @type.nil?

  # conversion for effective_date [type = org.joda.time.DateTime]
  if !@effective_date.nil?
    @effective_date =  (@effective_date.kind_of? Time) ? DateTime.parse(@effective_date.to_s) : @effective_date
    @effective_date = Java::org.joda.time.DateTime.new(@effective_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
  end

  # conversion for is_block_change [type = boolean]
  @is_block_change = @is_block_change.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(@is_block_change)

  # conversion for is_block_entitlement [type = boolean]
  @is_block_entitlement = @is_block_entitlement.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(@is_block_entitlement)

  # conversion for is_block_billing [type = boolean]
  @is_block_billing = @is_block_billing.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(@is_block_billing)

  # conversion for description [type = java.lang.String]
  @description = @description.to_s unless @description.nil?

  # conversion for service [type = java.lang.String]
  @service = @service.to_s unless @service.nil?
  self
end

#to_ruby(j_obj) ⇒ Object



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/killbill/gen/api/blocking_state.rb', line 90

def to_ruby(j_obj)
  # conversion for id [type = java.util.UUID]
  @id = j_obj.id
  @id = @id.nil? ? nil : @id.to_s

  # conversion for created_date [type = org.joda.time.DateTime]
  @created_date = j_obj.created_date
  if !@created_date.nil?
    fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time_no_millis # See https://github.com/killbill/killbill-java-parser/issues/3
    str = fmt.print(@created_date)
    @created_date = DateTime.iso8601(str)
  end

  # conversion for updated_date [type = org.joda.time.DateTime]
  @updated_date = j_obj.updated_date
  if !@updated_date.nil?
    fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time_no_millis # See https://github.com/killbill/killbill-java-parser/issues/3
    str = fmt.print(@updated_date)
    @updated_date = DateTime.iso8601(str)
  end

  # conversion for blocked_id [type = java.util.UUID]
  @blocked_id = j_obj.blocked_id
  @blocked_id = @blocked_id.nil? ? nil : @blocked_id.to_s

  # conversion for state_name [type = java.lang.String]
  @state_name = j_obj.state_name

  # conversion for type [type = org.killbill.billing.entitlement.api.BlockingStateType]
  @type = j_obj.type
  @type = @type.to_s.to_sym unless @type.nil?

  # conversion for effective_date [type = org.joda.time.DateTime]
  @effective_date = j_obj.effective_date
  if !@effective_date.nil?
    fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time_no_millis # See https://github.com/killbill/killbill-java-parser/issues/3
    str = fmt.print(@effective_date)
    @effective_date = DateTime.iso8601(str)
  end

  # conversion for is_block_change [type = boolean]
  @is_block_change = j_obj.is_block_change
  if @is_block_change.nil?
    @is_block_change = false
  else
    tmp_bool = (@is_block_change.java_kind_of? java.lang.Boolean) ? @is_block_change.boolean_value : @is_block_change
    @is_block_change = tmp_bool ? true : false
  end

  # conversion for is_block_entitlement [type = boolean]
  @is_block_entitlement = j_obj.is_block_entitlement
  if @is_block_entitlement.nil?
    @is_block_entitlement = false
  else
    tmp_bool = (@is_block_entitlement.java_kind_of? java.lang.Boolean) ? @is_block_entitlement.boolean_value : @is_block_entitlement
    @is_block_entitlement = tmp_bool ? true : false
  end

  # conversion for is_block_billing [type = boolean]
  @is_block_billing = j_obj.is_block_billing
  if @is_block_billing.nil?
    @is_block_billing = false
  else
    tmp_bool = (@is_block_billing.java_kind_of? java.lang.Boolean) ? @is_block_billing.boolean_value : @is_block_billing
    @is_block_billing = tmp_bool ? true : false
  end

  # conversion for description [type = java.lang.String]
  @description = j_obj.description

  # conversion for service [type = java.lang.String]
  @service = j_obj.service
  self
end