Package org.optaplanner.core.impl.domain.entity.descriptor

## Class EntityDescriptor<Solution_>

- java.lang.Object
- - org.optaplanner.core.impl.domain.entity.descriptor.EntityDescriptor<Solution_>

- Type Parameters:
    `Solution_` - the solution type, the class with the `PlanningSolution` annotation

      public class EntityDescriptor<Solution_>
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected org.slf4j.Logger` | `logger` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `EntityDescriptor​(SolutionDescriptor<Solution_> solutionDescriptor, Class<?> entityClass)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `buildInvalidVariableNameExceptionMessage​(String variableName)` |
    `int` | `countReinitializableVariables​(ScoreDirector<Solution_> scoreDirector, Object entity)` |
    `int` | `countUninitializedVariables​(Object entity)` |
    `List<Object>` | `extractEntities​(Solution_ solution)` |
    `Collection<GenuineVariableDescriptor<Solution_>>` | `getDeclaredGenuineVariableDescriptors()` |
    `Collection<ShadowVariableDescriptor<Solution_>>` | `getDeclaredShadowVariableDescriptors()` |
    `Collection<VariableDescriptor<Solution_>>` | `getDeclaredVariableDescriptors()` |
    `SelectionSorter` | `getDecreasingDifficultySorter()` |
    `SelectionFilter` | `getEffectiveMovableEntitySelectionFilter()` |
    `Class<?>` | `getEntityClass()` |
    `long` | `getGenuineVariableCount()` |
    `GenuineVariableDescriptor<Solution_>` | `getGenuineVariableDescriptor​(String variableName)` |
    `List<GenuineVariableDescriptor<Solution_>>` | `getGenuineVariableDescriptorList()` |
    `Map<String,​GenuineVariableDescriptor<Solution_>>` | `getGenuineVariableDescriptorMap()` |
    `Collection<GenuineVariableDescriptor<Solution_>>` | `getGenuineVariableDescriptors()` |
    `Collection<String>` | `getGenuineVariableNameSet()` |
    `Predicate<Object>` | `getIsInitializedPredicate()` | Using entityDescriptor::isInitialized directly breaks node sharing because it creates multiple instances of this `Predicate`.
    `long` | `getMaximumValueCount​(Solution_ solution, Object entity)` |
    `long` | `getProblemScale​(Solution_ solution, Object entity)` |
    `ShadowVariableDescriptor<Solution_>` | `getShadowVariableDescriptor​(String variableName)` |
    `Map<String,​ShadowVariableDescriptor<Solution_>>` | `getShadowVariableDescriptorMap()` |
    `Collection<ShadowVariableDescriptor<Solution_>>` | `getShadowVariableDescriptors()` |
    `SolutionDescriptor<Solution_>` | `getSolutionDescriptor()` |
    `VariableDescriptor<Solution_>` | `getVariableDescriptor​(String variableName)` |
    `Map<String,​VariableDescriptor<Solution_>>` | `getVariableDescriptorMap()` |
    `Collection<VariableDescriptor<Solution_>>` | `getVariableDescriptors()` |
    `boolean` | `hasAnyChainedGenuineVariables()` |
    `boolean` | `hasAnyDeclaredGenuineVariableDescriptor()` |
    `boolean` | `hasAnyGenuineVariables()` |
    `boolean` | `hasEffectiveMovableEntitySelectionFilter()` |
    `boolean` | `hasGenuineVariableDescriptor​(String variableName)` |
    `boolean` | `hasShadowVariableDescriptor​(String variableName)` |
    `boolean` | `hasVariableDescriptor​(String variableName)` |
    `boolean` | `isEntityInitializedOrPinned​(ScoreDirector<Solution_> scoreDirector, Object entity)` |
    `boolean` | `isInitialized​(Object entity)` |
    `boolean` | `isMovable​(ScoreDirector<Solution_> scoreDirector, Object entity)` |
    `void` | `linkEntityDescriptors​(DescriptorPolicy descriptorPolicy)` |
    `void` | `linkVariableDescriptors​(DescriptorPolicy descriptorPolicy)` |
    `boolean` | `matchesEntity​(Object entity)` |
    `void` | `processAnnotations​(DescriptorPolicy descriptorPolicy)` |
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### logger

          protected final transient org.slf4j.Logger logger

  - ### Constructor Detail

    - #### EntityDescriptor

          public EntityDescriptor​(SolutionDescriptor<Solution_> solutionDescriptor,
                                  Class<?> entityClass)

  - ### Method Detail

    - #### getIsInitializedPredicate

          public Predicate<Object> getIsInitializedPredicate()

      Using entityDescriptor::isInitialized directly breaks node sharing because it creates multiple instances of this `Predicate`.
      Returns:
        never null, always the same `Predicate` instance to `isInitialized(Object)`

    - #### processAnnotations

          public void processAnnotations​(DescriptorPolicy descriptorPolicy)

    - #### linkEntityDescriptors

          public void linkEntityDescriptors​(DescriptorPolicy descriptorPolicy)

    - #### linkVariableDescriptors

          public void linkVariableDescriptors​(DescriptorPolicy descriptorPolicy)

    - #### getSolutionDescriptor

          public SolutionDescriptor<Solution_> getSolutionDescriptor()

    - #### getEntityClass

          public Class<?> getEntityClass()

    - #### matchesEntity

          public boolean matchesEntity​(Object entity)

    - #### hasEffectiveMovableEntitySelectionFilter

          public boolean hasEffectiveMovableEntitySelectionFilter()

    - #### getEffectiveMovableEntitySelectionFilter

          public SelectionFilter getEffectiveMovableEntitySelectionFilter()

    - #### getDecreasingDifficultySorter

          public SelectionSorter getDecreasingDifficultySorter()

    - #### hasAnyDeclaredGenuineVariableDescriptor

          public boolean hasAnyDeclaredGenuineVariableDescriptor()

    - #### getGenuineVariableNameSet

          public Collection<String> getGenuineVariableNameSet()

    - #### getGenuineVariableDescriptorMap

          public Map<String,​GenuineVariableDescriptor<Solution_>> getGenuineVariableDescriptorMap()

    - #### getGenuineVariableDescriptors

          public Collection<GenuineVariableDescriptor<Solution_>> getGenuineVariableDescriptors()

    - #### getGenuineVariableDescriptorList

          public List<GenuineVariableDescriptor<Solution_>> getGenuineVariableDescriptorList()

    - #### hasGenuineVariableDescriptor

          public boolean hasGenuineVariableDescriptor​(String variableName)

    - #### getGenuineVariableDescriptor

          public GenuineVariableDescriptor<Solution_> getGenuineVariableDescriptor​(String variableName)

    - #### getShadowVariableDescriptorMap

          public Map<String,​ShadowVariableDescriptor<Solution_>> getShadowVariableDescriptorMap()

    - #### getShadowVariableDescriptors

          public Collection<ShadowVariableDescriptor<Solution_>> getShadowVariableDescriptors()

    - #### hasShadowVariableDescriptor

          public boolean hasShadowVariableDescriptor​(String variableName)

    - #### getShadowVariableDescriptor

          public ShadowVariableDescriptor<Solution_> getShadowVariableDescriptor​(String variableName)

    - #### getVariableDescriptorMap

          public Map<String,​VariableDescriptor<Solution_>> getVariableDescriptorMap()

    - #### getVariableDescriptors

          public Collection<VariableDescriptor<Solution_>> getVariableDescriptors()

    - #### hasVariableDescriptor

          public boolean hasVariableDescriptor​(String variableName)

    - #### getVariableDescriptor

          public VariableDescriptor<Solution_> getVariableDescriptor​(String variableName)

    - #### getDeclaredGenuineVariableDescriptors

          public Collection<GenuineVariableDescriptor<Solution_>> getDeclaredGenuineVariableDescriptors()

    - #### getDeclaredShadowVariableDescriptors

          public Collection<ShadowVariableDescriptor<Solution_>> getDeclaredShadowVariableDescriptors()

    - #### getDeclaredVariableDescriptors

          public Collection<VariableDescriptor<Solution_>> getDeclaredVariableDescriptors()

    - #### buildInvalidVariableNameExceptionMessage

          public String buildInvalidVariableNameExceptionMessage​(String variableName)

    - #### hasAnyGenuineVariables

          public boolean hasAnyGenuineVariables()

    - #### hasAnyChainedGenuineVariables

          public boolean hasAnyChainedGenuineVariables()

    - #### extractEntities

          public List<Object> extractEntities​(Solution_ solution)

    - #### getGenuineVariableCount

          public long getGenuineVariableCount()

    - #### getMaximumValueCount

          public long getMaximumValueCount​(Solution_ solution,
                                           Object entity)

    - #### getProblemScale

          public long getProblemScale​(Solution_ solution,
                                      Object entity)

    - #### countUninitializedVariables

          public int countUninitializedVariables​(Object entity)

    - #### isInitialized

          public boolean isInitialized​(Object entity)

    - #### countReinitializableVariables

          public int countReinitializableVariables​(ScoreDirector<Solution_> scoreDirector,
                                                   Object entity)

    - #### isMovable

          public boolean isMovable​(ScoreDirector<Solution_> scoreDirector,
                                   Object entity)

    - #### isEntityInitializedOrPinned

          public boolean isEntityInitializedOrPinned​(ScoreDirector<Solution_> scoreDirector,
                                                     Object entity)

      Parameters:
        `scoreDirector` - never null
        `entity` - never null
      Returns:
        true if the entity is initialized or pinned

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`