Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.paypal.api.payments;
 public class Cost  {

Cost in percent. Range of 0 to 100.
	private float percent;

Cost in amount. Range of 0 to 999999.99.
	private Currency amount;

Default Constructor
	public Cost() {

Setter for percent
	public Cost setPercent(float percent) {
		this. = percent;
		return this;

Getter for percent
	public float getPercent() {
		return this.;

Setter for amount
	public Cost setAmount(Currency amount) {
		this. = amount;
		return this;

Getter for amount
	public Currency getAmount() {
		return this.;

Returns a JSON string corresponding to object state

JSON representation
	public String toJSON() {
		return JSONFormatter.toJSON(this);
	public String toString() {
		return toJSON();
New to GrepCode? Check out our FAQ X