Class: Killbill::Plugin::Model::TagDefinition
- Defined in:
- lib/killbill/gen/api/tag_definition.rb
Instance Attribute Summary collapse
-
#applicable_object_types ⇒ Object
Returns the value of attribute applicable_object_types.
-
#created_date ⇒ Object
Returns the value of attribute created_date.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_control_tag ⇒ Object
Returns the value of attribute is_control_tag.
-
#name ⇒ Object
Returns the value of attribute name.
-
#updated_date ⇒ Object
Returns the value of attribute updated_date.
Instance Method Summary collapse
-
#initialize ⇒ TagDefinition
constructor
A new instance of TagDefinition.
- #to_java ⇒ Object
- #to_ruby(j_obj) ⇒ Object
Constructor Details
#initialize ⇒ TagDefinition
Returns a new instance of TagDefinition.
39 40 |
# File 'lib/killbill/gen/api/tag_definition.rb', line 39 def initialize() end |
Instance Attribute Details
#applicable_object_types ⇒ Object
Returns the value of attribute applicable_object_types.
37 38 39 |
# File 'lib/killbill/gen/api/tag_definition.rb', line 37 def applicable_object_types @applicable_object_types end |
#created_date ⇒ Object
Returns the value of attribute created_date.
37 38 39 |
# File 'lib/killbill/gen/api/tag_definition.rb', line 37 def created_date @created_date end |
#description ⇒ Object
Returns the value of attribute description.
37 38 39 |
# File 'lib/killbill/gen/api/tag_definition.rb', line 37 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
37 38 39 |
# File 'lib/killbill/gen/api/tag_definition.rb', line 37 def id @id end |
#is_control_tag ⇒ Object
Returns the value of attribute is_control_tag.
37 38 39 |
# File 'lib/killbill/gen/api/tag_definition.rb', line 37 def is_control_tag @is_control_tag end |
#name ⇒ Object
Returns the value of attribute name.
37 38 39 |
# File 'lib/killbill/gen/api/tag_definition.rb', line 37 def name @name end |
#updated_date ⇒ Object
Returns the value of attribute updated_date.
37 38 39 |
# File 'lib/killbill/gen/api/tag_definition.rb', line 37 def updated_date @updated_date end |
Instance Method Details
#to_java ⇒ Object
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 |
# File 'lib/killbill/gen/api/tag_definition.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 name [type = java.lang.String] @name = @name.to_s unless @name.nil? # conversion for description [type = java.lang.String] @description = @description.to_s unless @description.nil? # conversion for is_control_tag [type = java.lang.Boolean] @is_control_tag = @is_control_tag.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(@is_control_tag) # conversion for applicable_object_types [type = java.util.List] tmp = java.util.ArrayList.new (@applicable_object_types || []).each do |m| # conversion for m [type = org.killbill.billing.ObjectType] m = Java::org.killbill.billing.ObjectType.value_of( m.to_s ) unless m.nil? tmp.add(m) end @applicable_object_types = tmp self end |
#to_ruby(j_obj) ⇒ Object
78 79 80 81 82 83 84 85 86 87 88 89 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 |
# File 'lib/killbill/gen/api/tag_definition.rb', line 78 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 name [type = java.lang.String] @name = j_obj.name # conversion for description [type = java.lang.String] @description = j_obj.description # conversion for is_control_tag [type = java.lang.Boolean] @is_control_tag = j_obj.is_control_tag if @is_control_tag.nil? @is_control_tag = false else tmp_bool = (@is_control_tag.java_kind_of? java.lang.Boolean) ? @is_control_tag.boolean_value : @is_control_tag @is_control_tag = tmp_bool ? true : false end # conversion for applicable_object_types [type = java.util.List] @applicable_object_types = j_obj.applicable_object_types tmp = [] (@applicable_object_types || []).each do |m| # conversion for m [type = org.killbill.billing.ObjectType] m = m.to_s.to_sym unless m.nil? tmp << m end @applicable_object_types = tmp self end |