Class: Killbill::Plugin::Model::ImmutableAccountData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeImmutableAccountData

Returns a new instance of ImmutableAccountData.



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

def initialize()
end

Instance Attribute Details

#currencyObject

Returns the value of attribute currency.



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

def currency
  @currency
end

#external_keyObject

Returns the value of attribute external_key.



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

def external_key
  @external_key
end

#fixed_offset_time_zoneObject

Returns the value of attribute fixed_offset_time_zone.



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

def fixed_offset_time_zone
  @fixed_offset_time_zone
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#reference_timeObject

Returns the value of attribute reference_time.



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

def reference_time
  @reference_time
end

#time_zoneObject

Returns the value of attribute time_zone.



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

def time_zone
  @time_zone
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
# File 'lib/killbill/gen/api/immutable_account_data.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 external_key [type = java.lang.String]
  @external_key = @external_key.to_s unless @external_key.nil?

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

  # conversion for time_zone [type = org.joda.time.DateTimeZone]
  if !@time_zone.nil?
    @time_zone = Java::org.joda.time.DateTimeZone.forID((@time_zone.respond_to?(:identifier) ? @time_zone.identifier : @time_zone.to_s))
  end

  # conversion for fixed_offset_time_zone [type = org.joda.time.DateTimeZone]
  if !@fixed_offset_time_zone.nil?
    @fixed_offset_time_zone = Java::org.joda.time.DateTimeZone.forID((@fixed_offset_time_zone.respond_to?(:identifier) ? @fixed_offset_time_zone.identifier : @fixed_offset_time_zone.to_s))
  end

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

#to_ruby(j_obj) ⇒ Object



70
71
72
73
74
75
76
77
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
# File 'lib/killbill/gen/api/immutable_account_data.rb', line 70

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 external_key [type = java.lang.String]
  @external_key = j_obj.external_key

  # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
  @currency = j_obj.currency
  @currency = @currency.to_s.to_sym unless @currency.nil?

  # conversion for time_zone [type = org.joda.time.DateTimeZone]
  @time_zone = j_obj.time_zone
  if !@time_zone.nil?
    @time_zone = TZInfo::Timezone.get(@time_zone.get_id) rescue @time_zone.get_id
  end

  # conversion for fixed_offset_time_zone [type = org.joda.time.DateTimeZone]
  @fixed_offset_time_zone = j_obj.fixed_offset_time_zone
  if !@fixed_offset_time_zone.nil?
    @fixed_offset_time_zone = TZInfo::Timezone.get(@fixed_offset_time_zone.get_id) rescue @fixed_offset_time_zone.get_id
  end

  # conversion for reference_time [type = org.joda.time.DateTime]
  @reference_time = j_obj.reference_time
  if !@reference_time.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(@reference_time)
    @reference_time = DateTime.iso8601(str)
  end
  self
end