Class: Killbill::Plugin::Model::RolledUpUsage

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRolledUpUsage

Returns a new instance of RolledUpUsage.



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

def initialize()
end

Instance Attribute Details

#endObject

Returns the value of attribute end.



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

def end
  @end
end

#rolled_up_unitsObject

Returns the value of attribute rolled_up_units.



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

def rolled_up_units
  @rolled_up_units
end

#startObject

Returns the value of attribute start.



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

def start
  @start
end

#subscription_idObject

Returns the value of attribute subscription_id.



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

def subscription_id
  @subscription_id
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
# File 'lib/killbill/gen/api/rolled_up_usage.rb', line 42

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

  # conversion for start [type = org.joda.time.LocalDate]
  if !@start.nil?
    @start = Java::org.joda.time.LocalDate.parse(@start.to_s)
  end

  # conversion for end [type = org.joda.time.LocalDate]
  if !@end.nil?
    @end = Java::org.joda.time.LocalDate.parse(@end.to_s)
  end

  # conversion for rolled_up_units [type = java.util.List]
  tmp = java.util.ArrayList.new
  (@rolled_up_units || []).each do |m|
    # conversion for m [type = org.killbill.billing.usage.api.RolledUpUnit]
    m = m.to_java unless m.nil?
    tmp.add(m)
  end
  @rolled_up_units = tmp
  self
end

#to_ruby(j_obj) ⇒ Object



67
68
69
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
# File 'lib/killbill/gen/api/rolled_up_usage.rb', line 67

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

  # conversion for start [type = org.joda.time.LocalDate]
  @start = j_obj.start
  if !@start.nil?
    @start = @start.to_s
  end

  # conversion for end [type = org.joda.time.LocalDate]
  @end = j_obj.end
  if !@end.nil?
    @end = @end.to_s
  end

  # conversion for rolled_up_units [type = java.util.List]
  @rolled_up_units = j_obj.rolled_up_units
  tmp = []
  (@rolled_up_units || []).each do |m|
    # conversion for m [type = org.killbill.billing.usage.api.RolledUpUnit]
    m = Killbill::Plugin::Model::RolledUpUnit.new.to_ruby(m) unless m.nil?
    tmp << m
  end
  @rolled_up_units = tmp
  self
end