com.phloc.masterdata.trade.EIncoterm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of phloc-masterdata Show documentation
Show all versions of phloc-masterdata Show documentation
Library with support for certain re-ocurring standard business objects
/**
* Copyright (C) 2006-2014 phloc systems
* http://www.phloc.com
* office[at]phloc[dot]com
*
* Licensed 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.
*/
package com.phloc.masterdata.trade;
import java.util.Locale;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.phloc.commons.annotations.Nonempty;
import com.phloc.commons.id.IHasID;
import com.phloc.commons.lang.EnumHelper;
import com.phloc.commons.name.IHasDisplayText;
/**
* Possible delivery terms based on Incoterms.
* See Technical documentation 6.5
* http://de.wikipedia.org/wiki/Incoterms
*
* @author Philip Helger
*/
public enum EIncoterm implements IHasID , IHasDisplayText
{
// Order as in in Incoterms 2000
EXW ("EXW", EIncotermName.EXW),
FCA ("FCA", EIncotermName.FCA),
FAS ("FAS", EIncotermName.FAS),
FOB ("FOB", EIncotermName.FOB),
CFR ("CFR", EIncotermName.CFR),
CIF ("CIF", EIncotermName.CIF),
CPT ("CPT", EIncotermName.CPT),
CIP ("CIP", EIncotermName.CIP),
DAF ("DAF", EIncotermName.DAF),
DES ("DES", EIncotermName.DES),
DEQ ("DEQ", EIncotermName.DEQ),
DDU ("DDU", EIncotermName.DDU),
DDP ("DDP", EIncotermName.DDP);
private final String m_sID;
private final IHasDisplayText m_aName;
private EIncoterm (@Nonnull @Nonempty final String sID, @Nonnull final EIncotermName eDeliveryTermName)
{
m_sID = sID;
m_aName = eDeliveryTermName;
}
@Nonnull
@Nonempty
public String getID ()
{
return m_sID;
}
@Nonnull
public String getDisplayText (@Nonnull final Locale aContentLocale)
{
return m_aName.getDisplayText (aContentLocale) + " (" + m_sID + ')';
}
@Nullable
public static EIncoterm getFromIDOrNull (@Nullable final String sID)
{
return EnumHelper.getFromIDOrNull (EIncoterm.class, sID);
}
}