- java.lang.Object
-
- java.lang.Enum<Multiplicity>
-
- org.mal_lang.langspec.Multiplicity
-
- All Implemented Interfaces:
Serializable
,Comparable<Multiplicity>
public enum Multiplicity extends Enum<Multiplicity>
Enum representing the multiplicity of a field of an asset in a MAL language.- Since:
- 1.0.0
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ONE
Enum constant representing the multiplicity1..1
/1
.ONE_OR_MORE
Enum constant representing the multiplicity1..*
.ZERO_OR_MORE
Enum constant representing the multiplicity0..*
/*
.ZERO_OR_ONE
Enum constant representing the multiplicity0..1
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Multiplicity
fromJson(JsonObject jsonMultiplicity)
Creates a newMultiplicity
from aJsonObject
.int
getMax()
Returns the maximum of thisMultiplicity
object.int
getMin()
Returns the minimum of thisMultiplicity
object.static Multiplicity
valueOf(String name)
Returns the enum constant of this type with the specified name.static Multiplicity[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ZERO_OR_ONE
public static final Multiplicity ZERO_OR_ONE
Enum constant representing the multiplicity0..1
.- Since:
- 1.0.0
-
ZERO_OR_MORE
public static final Multiplicity ZERO_OR_MORE
Enum constant representing the multiplicity0..*
/*
.- Since:
- 1.0.0
-
ONE
public static final Multiplicity ONE
Enum constant representing the multiplicity1..1
/1
.- Since:
- 1.0.0
-
ONE_OR_MORE
public static final Multiplicity ONE_OR_MORE
Enum constant representing the multiplicity1..*
.- Since:
- 1.0.0
-
-
Method Detail
-
values
public static Multiplicity[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Multiplicity c : Multiplicity.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Multiplicity valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getMin
public int getMin()
Returns the minimum of thisMultiplicity
object.- Returns:
- the minimum of this
Multiplicity
object - Since:
- 1.0.0
-
getMax
public int getMax()
Returns the maximum of thisMultiplicity
object.- Returns:
- the maximum of this
Multiplicity
object - Since:
- 1.0.0
-
fromJson
public static Multiplicity fromJson(JsonObject jsonMultiplicity)
Creates a newMultiplicity
from aJsonObject
.- Parameters:
jsonMultiplicity
- theJsonObject
- Returns:
- a new
Multiplicity
- Throws:
NullPointerException
- ifjsonMultiplicity
isnull
- Since:
- 1.0.0
-
-