Class PropertyPool

java.lang.Object
com.nomagic.magicdraw.properties.PropertyPool

@OpenApiAll public class PropertyPool extends 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 Details

    • PropertyPool

      public PropertyPool()
  • Method Details

    • 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(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(String id, boolean value, @CheckForNull 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(String id, 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(String id, Color value, @CheckForNull 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(String id, 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(String id, Font value, @CheckForNull 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(String id, Object value, 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(String id, @CheckForNull Object value, List possibleValues, @CheckForNull 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
    • getProperty

      public static Property getProperty(Property property)
      Returns shared instance of given property. If this pool can not create shared instance, return given property.
      Parameters:
      property - the given property.
      Returns:
      cached property