Enum MappingCardinality
- java.lang.Object
-
- java.lang.Enum<MappingCardinality>
-
- org.incenp.obofoundry.sssom.model.MappingCardinality
-
- All Implemented Interfaces:
Serializable,Comparable<MappingCardinality>
public enum MappingCardinality extends Enum<MappingCardinality>
Represents the cardinality of a mapping. This indicates whether a mapping is between exactly one subject and one object, between one subject and several objects, etc.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description MANY_TO_MANYMANY_TO_ONENONE_TO_NONENONE_TO_ONEONE_TO_MANYONE_TO_NONEONE_TO_ONE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static MappingCardinalityfromString(String v)Parses a string into a mapping cardinality enum value.MappingCardinalitygetInverse()Gets the inverse of this cardinality (i.e., "1:n" -> "n:1").static StringgetObject(Mapping mapping)Deprecated.UseCardinalizer.getObject(Mapping)instead.static StringgetSubject(Mapping mapping)Deprecated.UseCardinalizer.getSubject(Mapping)instead.static voidinferCardinality(List<Mapping> mappings)Deprecated.UseCardinalizer.fillCardinality(List)instead.StringtoString()static MappingCardinalityvalueOf(String name)Returns the enum constant of this type with the specified name.static MappingCardinality[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ONE_TO_ONE
public static final MappingCardinality ONE_TO_ONE
-
ONE_TO_MANY
public static final MappingCardinality ONE_TO_MANY
-
MANY_TO_ONE
public static final MappingCardinality MANY_TO_ONE
-
ONE_TO_NONE
public static final MappingCardinality ONE_TO_NONE
-
NONE_TO_ONE
public static final MappingCardinality NONE_TO_ONE
-
MANY_TO_MANY
public static final MappingCardinality MANY_TO_MANY
-
NONE_TO_NONE
public static final MappingCardinality NONE_TO_NONE
-
-
Method Detail
-
values
public static MappingCardinality[] 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 (MappingCardinality c : MappingCardinality.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MappingCardinality 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
-
toString
public String toString()
- Overrides:
toStringin classEnum<MappingCardinality>
-
getInverse
public MappingCardinality getInverse()
Gets the inverse of this cardinality (i.e., "1:n" -> "n:1").- Returns:
- The inverse cardinality (may be identical, e.g. for "1:1").
-
fromString
public static MappingCardinality fromString(String v)
Parses a string into a mapping cardinality enum value.- Parameters:
v- The string to parse.- Returns:
- The corresponding enumeration value, of
nullif the provided string does not match any mapping cardinality.
-
inferCardinality
@Deprecated public static void inferCardinality(List<Mapping> mappings)
Deprecated.UseCardinalizer.fillCardinality(List)instead.Infers the cardinality for all mappings in the given list. This overrides any cardinality information that may already be stored in each mapping.- Parameters:
mappings- The mappings for which to infer cardinality.
-
getSubject
@Deprecated public static String getSubject(Mapping mapping)
Deprecated.UseCardinalizer.getSubject(Mapping)instead.Gets a string representing the subject that can be used for cardinality computation. The returned value takes into account the subject_id (or the subject_label if the subject is a literal) and the subject_type.- Parameters:
mapping- The mapping from which to derive a subject string.- Returns:
- A string that can be used to compare subjects across mappings.
-
getObject
@Deprecated public static String getObject(Mapping mapping)
Deprecated.UseCardinalizer.getObject(Mapping)instead.Gets a string representing the object that can be used for cardinality computation. The returned value takes into account the object_id (or the object_label if the object is a literal) and the object_type.- Parameters:
mapping- The mapping from which to derive an object string.- Returns:
- A String that can be used to compare objects across mappings.
-
-