Package oracle.pgx.common.types
Class TypeConverter
- java.lang.Object
-
- oracle.pgx.common.types.TypeConverter
-
public final class TypeConverter extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PropertyTypeentityTypeToPropertyType(EntityType type)Converts an entity type to a property type.static IdTypegetIdTypeForPropertyType(PropertyType propertyType)Converts an IdType to the corresponding matching property typestatic PropertyTypegetPropertyTypeForIdType(IdType idType)Converts an IdType to the corresponding matching property typestatic EntityTypepropertyTypeToEntityType(PropertyType type)Delegate topropertyTypeToEntityType(PropertyType, boolean)withstrict = truestatic EntityTypepropertyTypeToEntityType(PropertyType type, boolean strict)Converts a property type to an entity type.
-
-
-
Method Detail
-
entityTypeToPropertyType
public static PropertyType entityTypeToPropertyType(EntityType type)
Converts an entity type to a property type. Throws an exception for invalid entity types. ConvertsEntityType.VERTEXtoPropertyType.VERTEXandEntityType.EDGEtoPropertyType.EDGE.- Parameters:
type- the entity type to convert- Returns:
- the equivalent property type to the given entity type
- See Also:
propertyTypeToEntityType(PropertyType, boolean)
-
propertyTypeToEntityType
public static EntityType propertyTypeToEntityType(PropertyType type)
Delegate topropertyTypeToEntityType(PropertyType, boolean)withstrict = true- Parameters:
type- the property type to convert- Returns:
- the equivalent entity type for the given property type
- See Also:
propertyTypeToEntityType(PropertyType, boolean)
-
propertyTypeToEntityType
public static EntityType propertyTypeToEntityType(PropertyType type, boolean strict)
Converts a property type to an entity type. If thestrictparameter is true, an exception is thrown when a PropertyType is not convertible to an EntityType. Otherwisenullis returned. ConvertsPropertyType.VERTEXtoEntityType.VERTEXandPropertyType.EDGEtoEntityType.EDGE.- Parameters:
type- the property type to convertstrict- if true throw exception on not convertible types. If false return null in that case- Returns:
- the equivalent entity type for the given property type, or null if strict = true and the type is not convertible.
- See Also:
propertyTypeToEntityType(PropertyType),entityTypeToPropertyType(EntityType)
-
getPropertyTypeForIdType
public static PropertyType getPropertyTypeForIdType(IdType idType)
Converts an IdType to the corresponding matching property type- Parameters:
idType- the id type we want to know the matching property type of- Returns:
- the property type to which this id type corresponds to
-
getIdTypeForPropertyType
public static IdType getIdTypeForPropertyType(PropertyType propertyType)
Converts an IdType to the corresponding matching property type- Parameters:
propertyType- the id type we want to know the matching property type of- Returns:
- the property type to which this id type corresponds to
-
-