All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javax.money.CurrencyContext Maven / Gradle / Ivy

Go to download

JSR 354 provides an API for representing, transporting, and performing comprehensive calculations with Money and Currency. This module provides a forward compatible backport of the API.

There is a newer version: 1.0.4
Show newest version
/*
 * CREDIT SUISSE IS WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU
 * ACCEPT ALL OF THE TERMS CONTAINED IN THIS AGREEMENT. PLEASE READ THE TERMS AND CONDITIONS OF THIS
 * AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF
 * THE AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY IT, SELECT THE "DECLINE" BUTTON AT THE
 * BOTTOM OF THIS PAGE. Specification: JSR-354 Money and Currency API ("Specification") Copyright
 * (c) 2012-2013, Credit Suisse All rights reserved.
 */
package javax.money;

import java.io.Serializable;

/**
 * This class models the attributable context of {@link CurrencyUnit} instances. It
 * provides information about
 * 
    *
  • the provider that provided the instance (required) *
  • the target timestamp / temporal unit *
  • any other attributes, identified by the attribute type, e.g. regions, tenants etc. *
*

Instances of this class must be created using the {@link CurrencyContextBuilder}. Typically the * contexts are created and assigned by the classes that implement the {@link javax.money.spi.CurrencyProviderSpi}. * The according implementation classes should document, which attributes are available.

*

* This class is immutable, serializable and thread-safe. * * @author Anatole Tresch */ public final class CurrencyContext extends AbstractContext implements Serializable{ /** * Constructor, used from the {@link CurrencyContextBuilder}. * * @param builder the corresponding builder, not null. */ CurrencyContext(CurrencyContextBuilder builder){ super(builder); } /** * Allows to convert a instance into the corresponding {@link CurrencyContextBuilder}, which allows * to change the values and of another {@link CurrencyContext} instance. * * @return a new Builder instance, preinitialized with the values from this instance. */ public CurrencyContextBuilder toBuilder(){ return CurrencyContextBuilder.of(this); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy