Package com.nomagic.magicdraw.properties
Class PropertyPool
- java.lang.Object
-
- com.nomagic.magicdraw.properties.PropertyPool
-
@OpenApiAll public class PropertyPool extends java.lang.Object
This is a pool of the properties. Use this pool if you do not want to create a lot of instance of properties with the same ID and value.Be careful with changing the value of property taken from this pool. Property is mutable object!!!
-
-
Constructor Summary
Constructors Constructor Description PropertyPool()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BooleanProperty
getBooleanProperty(BooleanProperty p)
Returns shared instance of boolean property with the same id and value as given property.static BooleanProperty
getBooleanProperty(java.lang.String id, boolean value)
Returns shared instance of boolean property with the given id and value.static BooleanProperty
getBooleanProperty(java.lang.String id, boolean value, java.lang.String group)
Returns shared instance of boolean property with the given id and value.static ChoiceProperty
getChoiceProperty(ChoiceProperty p)
Returns shared instance of choice property with the same id and value as given property.static ChoiceProperty
getChoiceProperty(java.lang.String id, java.lang.Object value, java.util.List possibleValues)
Returns shared instance of choice property with the given id, value and possible values for selectionstatic ChoiceProperty
getChoiceProperty(java.lang.String id, java.lang.Object value, java.util.List possibleValues, java.lang.String group)
Returns shared instance of choice property with the given id, group, value and possible values for selectionstatic ColorProperty
getColorProperty(ColorProperty p)
Returns shared instance of color property with the same id and value as given property.static ColorProperty
getColorProperty(java.lang.String id, java.awt.Color value)
Returns shared instance of color property with the given id and value.static ColorProperty
getColorProperty(java.lang.String id, java.awt.Color value, java.lang.String group)
Returns shared instance of color property with the given id and value.static FontProperty
getFontProperty(FontProperty p)
Returns shared instance of font property with the same id and value as given property.static FontProperty
getFontProperty(java.lang.String id, java.awt.Font value)
Returns shared instance of font property with the given id and value.static FontProperty
getFontProperty(java.lang.String id, java.awt.Font value, java.lang.String group)
Returns shared instance of font property with the given id and value.static Property
getProperty(Property property)
Returns shared instance of given property.
-
-
-
Method Detail
-
getBooleanProperty
public static BooleanProperty getBooleanProperty(BooleanProperty p)
Returns shared instance of boolean property with the same id and value as given property.- Parameters:
p
- the given property.- Returns:
- shared instance.
-
getBooleanProperty
public static BooleanProperty getBooleanProperty(java.lang.String id, boolean value)
Returns shared instance of boolean property with the given id and value.- Parameters:
id
- the property id.value
- the given value of the property.- Returns:
- shared instance.
-
getBooleanProperty
public static BooleanProperty getBooleanProperty(java.lang.String id, boolean value, @CheckForNull java.lang.String group)
Returns shared instance of boolean property with the given id and value.- Parameters:
id
- the property id.value
- the given value of the property.group
- property group- Returns:
- shared instance
-
getColorProperty
public static ColorProperty getColorProperty(ColorProperty p)
Returns shared instance of color property with the same id and value as given property.- Parameters:
p
- the given property.- Returns:
- shared instance.
-
getColorProperty
public static ColorProperty getColorProperty(java.lang.String id, java.awt.Color value)
Returns shared instance of color property with the given id and value.- Parameters:
id
- the property id.value
- the given value of the property.- Returns:
- shared instance.
-
getColorProperty
public static ColorProperty getColorProperty(java.lang.String id, java.awt.Color value, @CheckForNull java.lang.String group)
Returns shared instance of color property with the given id and value.- Parameters:
id
- the property id.value
- the given value of the property.group
- property group- Returns:
- shared instance
-
getFontProperty
public static FontProperty getFontProperty(FontProperty p)
Returns shared instance of font property with the same id and value as given property.- Parameters:
p
- the given property.- Returns:
- shared instance.
-
getFontProperty
public static FontProperty getFontProperty(java.lang.String id, java.awt.Font value)
Returns shared instance of font property with the given id and value.- Parameters:
id
- the property id.value
- the given value of the property.- Returns:
- shared instance.
-
getFontProperty
public static FontProperty getFontProperty(java.lang.String id, java.awt.Font value, @CheckForNull java.lang.String group)
Returns shared instance of font property with the given id and value.- Parameters:
id
- the property id.value
- the given value of the property.group
- property group- Returns:
- shared instance
-
getChoiceProperty
public static ChoiceProperty getChoiceProperty(ChoiceProperty p)
Returns shared instance of choice property with the same id and value as given property.- Parameters:
p
- the given property.- Returns:
- shared instance.
-
getChoiceProperty
public static ChoiceProperty getChoiceProperty(java.lang.String id, java.lang.Object value, java.util.List possibleValues)
Returns shared instance of choice property with the given id, value and possible values for selection- Parameters:
id
- the property id.value
- the given value of the property.- Returns:
- shared instance.
-
getChoiceProperty
public static ChoiceProperty getChoiceProperty(java.lang.String id, @CheckForNull java.lang.Object value, java.util.List possibleValues, @CheckForNull java.lang.String group)
Returns shared instance of choice property with the given id, group, value and possible values for selection- Parameters:
id
- the property id.value
- the given value of the property.group
- property group- Returns:
- shared instance
-
-