############################################################################################# # # # Copyright 2010-2013 Ning, Inc. # # Copyright 2014 Groupon, Inc. # # Copyright 2014 The Billing Project, LLC # # # # The Billing Project licenses this file to you under the Apache License, version 2.0 # # (the "License"); you may not use this file except in compliance with the # # License. You may obtain a copy of the License at: # # # # http://www.apache.org/licenses/LICENSE-2.0 # # # # Unless required by applicable law or agreed to in writing, software # # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # # License for the specific language governing permissions and limitations # # under the License. # # # ############################################################################################# # # DO NOT EDIT!!! # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git) # module Killbill module Plugin module Model java_package 'org.killbill.billing.catalog.api' class SimplePlanDescriptor include org.killbill.billing.catalog.api.SimplePlanDescriptor attr_accessor :plan_id, :product_name, :product_category, :available_base_products, :currency, :amount, :billing_period, :trial_length, :trial_time_unit def initialize() end 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 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 end end end end