Class: Killbill::Plugin::Model::StandalonePluginCatalog

Inherits:
Object
  • Object
show all
Defined in:
lib/killbill/gen/plugin-api/standalone_plugin_catalog.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStandalonePluginCatalog

Returns a new instance of StandalonePluginCatalog.



39
40
# File 'lib/killbill/gen/plugin-api/standalone_plugin_catalog.rb', line 39

def initialize()
end

Instance Attribute Details

#children_price_listObject

Returns the value of attribute children_price_list.



37
38
39
# File 'lib/killbill/gen/plugin-api/standalone_plugin_catalog.rb', line 37

def children_price_list
  @children_price_list
end

#currenciesObject

Returns the value of attribute currencies.



37
38
39
# File 'lib/killbill/gen/plugin-api/standalone_plugin_catalog.rb', line 37

def currencies
  @currencies
end

#default_price_listObject

Returns the value of attribute default_price_list.



37
38
39
# File 'lib/killbill/gen/plugin-api/standalone_plugin_catalog.rb', line 37

def default_price_list
  @default_price_list
end

#effective_dateObject

Returns the value of attribute effective_date.



37
38
39
# File 'lib/killbill/gen/plugin-api/standalone_plugin_catalog.rb', line 37

def effective_date
  @effective_date
end

#plan_rulesObject

Returns the value of attribute plan_rules.



37
38
39
# File 'lib/killbill/gen/plugin-api/standalone_plugin_catalog.rb', line 37

def plan_rules
  @plan_rules
end

#plansObject

Returns the value of attribute plans.



37
38
39
# File 'lib/killbill/gen/plugin-api/standalone_plugin_catalog.rb', line 37

def plans
  @plans
end

#productsObject

Returns the value of attribute products.



37
38
39
# File 'lib/killbill/gen/plugin-api/standalone_plugin_catalog.rb', line 37

def products
  @products
end

#unitsObject

Returns the value of attribute units.



37
38
39
# File 'lib/killbill/gen/plugin-api/standalone_plugin_catalog.rb', line 37

def units
  @units
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
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/killbill/gen/plugin-api/standalone_plugin_catalog.rb', line 42

def to_java()
  # 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 currencies [type = java.lang.Iterable]
  tmp = java.util.ArrayList.new
  (@currencies || []).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.Currency]
    m = Java::org.killbill.billing.catalog.api.Currency.value_of( m.to_s ) unless m.nil?
    tmp.add(m)
  end
  @currencies = tmp

  # conversion for units [type = java.lang.Iterable]
  tmp = java.util.ArrayList.new
  (@units || []).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.Unit]
    m = m.to_java unless m.nil?
    tmp.add(m)
  end
  @units = tmp

  # conversion for products [type = java.lang.Iterable]
  tmp = java.util.ArrayList.new
  (@products || []).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.Product]
    m = m.to_java unless m.nil?
    tmp.add(m)
  end
  @products = tmp

  # conversion for plans [type = java.lang.Iterable]
  tmp = java.util.ArrayList.new
  (@plans || []).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.Plan]
    m = m.to_java unless m.nil?
    tmp.add(m)
  end
  @plans = tmp

  # conversion for default_price_list [type = org.killbill.billing.catalog.api.PriceList]
  @default_price_list = @default_price_list.to_java unless @default_price_list.nil?

  # conversion for children_price_list [type = java.lang.Iterable]
  tmp = java.util.ArrayList.new
  (@children_price_list || []).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.PriceList]
    m = m.to_java unless m.nil?
    tmp.add(m)
  end
  @children_price_list = tmp

  # conversion for plan_rules [type = org.killbill.billing.catalog.api.rules.PlanRules]
  @plan_rules = @plan_rules.to_java unless @plan_rules.nil?
  self
end

#to_ruby(j_obj) ⇒ Object



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
164
165
166
167
168
169
# File 'lib/killbill/gen/plugin-api/standalone_plugin_catalog.rb', line 102

def to_ruby(j_obj)
  # 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 currencies [type = java.lang.Iterable]
  @currencies = j_obj.currencies
  tmp = []
  (@currencies.nil? ? [] : @currencies.iterator).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.Currency]
    m = m.to_s.to_sym unless m.nil?
    tmp << m
  end
  @currencies = tmp

  # conversion for units [type = java.lang.Iterable]
  @units = j_obj.units
  tmp = []
  (@units.nil? ? [] : @units.iterator).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.Unit]
    m = Killbill::Plugin::Model::Unit.new.to_ruby(m) unless m.nil?
    tmp << m
  end
  @units = tmp

  # conversion for products [type = java.lang.Iterable]
  @products = j_obj.products
  tmp = []
  (@products.nil? ? [] : @products.iterator).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.Product]
    m = Killbill::Plugin::Model::Product.new.to_ruby(m) unless m.nil?
    tmp << m
  end
  @products = tmp

  # conversion for plans [type = java.lang.Iterable]
  @plans = j_obj.plans
  tmp = []
  (@plans.nil? ? [] : @plans.iterator).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.Plan]
    m = Killbill::Plugin::Model::Plan.new.to_ruby(m) unless m.nil?
    tmp << m
  end
  @plans = tmp

  # conversion for default_price_list [type = org.killbill.billing.catalog.api.PriceList]
  @default_price_list = j_obj.default_price_list
  @default_price_list = Killbill::Plugin::Model::PriceList.new.to_ruby(@default_price_list) unless @default_price_list.nil?

  # conversion for children_price_list [type = java.lang.Iterable]
  @children_price_list = j_obj.children_price_list
  tmp = []
  (@children_price_list.nil? ? [] : @children_price_list.iterator).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.PriceList]
    m = Killbill::Plugin::Model::PriceList.new.to_ruby(m) unless m.nil?
    tmp << m
  end
  @children_price_list = tmp

  # conversion for plan_rules [type = org.killbill.billing.catalog.api.rules.PlanRules]
  @plan_rules = j_obj.plan_rules
  @plan_rules = Killbill::Plugin::Model::PlanRules.new.to_ruby(@plan_rules) unless @plan_rules.nil?
  self
end