Class: Killbill::Plugin::Model::SimplePlanDescriptor

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSimplePlanDescriptor

Returns a new instance of SimplePlanDescriptor.



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

def initialize()
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



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

def amount
  @amount
end

#available_base_productsObject

Returns the value of attribute available_base_products.



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

def available_base_products
  @available_base_products
end

#billing_periodObject

Returns the value of attribute billing_period.



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

def billing_period
  @billing_period
end

#currencyObject

Returns the value of attribute currency.



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

def currency
  @currency
end

#plan_idObject

Returns the value of attribute plan_id.



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

def plan_id
  @plan_id
end

#product_categoryObject

Returns the value of attribute product_category.



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

def product_category
  @product_category
end

#product_nameObject

Returns the value of attribute product_name.



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

def product_name
  @product_name
end

#trial_lengthObject

Returns the value of attribute trial_length.



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

def trial_length
  @trial_length
end

#trial_time_unitObject

Returns the value of attribute trial_time_unit.



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

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

def to_java()
  # conversion for plan_id [type = java.lang.String]
  @plan_id = @plan_id.to_s unless @plan_id.nil?

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

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

  # conversion for available_base_products [type = java.util.List]
  tmp = java.util.ArrayList.new
  (@available_base_products || []).each do |m|
    # conversion for m [type = java.lang.String]
    m = m.to_s unless m.nil?
    tmp.add(m)
  end
  @available_base_products = tmp

  # 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 amount [type = java.math.BigDecimal]
  if @amount.nil?
    @amount = java.math.BigDecimal::ZERO
  else
    @amount = java.math.BigDecimal.new(@amount.to_s)
  end

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

  # conversion for trial_length [type = java.lang.Integer]
  @trial_length = @trial_length

  # conversion for trial_time_unit [type = org.killbill.billing.catalog.api.TimeUnit]
  @trial_time_unit = Java::org.killbill.billing.catalog.api.TimeUnit.value_of( @trial_time_unit.to_s ) unless @trial_time_unit.nil?
  self
end

#to_ruby(j_obj) ⇒ Object



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
# File 'lib/killbill/gen/api/simple_plan_descriptor.rb', line 82

def to_ruby(j_obj)
  # conversion for plan_id [type = java.lang.String]
  @plan_id = j_obj.plan_id

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

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

  # conversion for available_base_products [type = java.util.List]
  @available_base_products = j_obj.available_base_products
  tmp = []
  (@available_base_products || []).each do |m|
    # conversion for m [type = java.lang.String]
    tmp << m
  end
  @available_base_products = tmp

  # 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 amount [type = java.math.BigDecimal]
  @amount = j_obj.amount
  @amount = @amount.nil? ? 0 : BigDecimal.new(@amount.to_s)

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

  # conversion for trial_length [type = java.lang.Integer]
  @trial_length = j_obj.trial_length

  # conversion for trial_time_unit [type = org.killbill.billing.catalog.api.TimeUnit]
  @trial_time_unit = j_obj.trial_time_unit
  @trial_time_unit = @trial_time_unit.to_s.to_sym unless @trial_time_unit.nil?
  self
end