org.optaplanner.core.impl.heuristic.selector.entity.decorator

## Class PinEntityFilter<Solution_>

- java.lang.Object
- - org.optaplanner.core.impl.heuristic.selector.entity.decorator.PinEntityFilter<Solution_>

- Type Parameters:
    `Solution_` - the solution type, the class with the `PlanningSolution` annotation
  All Implemented Interfaces:
    SelectionFilter<Solution_,Object>

      public class PinEntityFilter<Solution_>
      extends Object
      implements SelectionFilter<Solution_,Object>

  Filters out entities that return true for the `PlanningPin` annotated boolean member.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PinEntityFilter(MemberAccessor memberAccessor)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `accept(ScoreDirector<Solution_> scoreDirector, Object entity)`

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

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

- - ### Constructor Detail

    - #### PinEntityFilter

          public PinEntityFilter(MemberAccessor memberAccessor)

  - ### Method Detail

    - #### accept

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

      Specified by:
        `accept` in interface `SelectionFilter<Solution_,Object>`
      Parameters:
        `scoreDirector` - never null, the `ScoreDirector` which has the `ScoreDirector.getWorkingSolution()` to which the selection belongs or applies to
        `entity` - never null, a `PlanningEntity`, a planningValue, a `Move` or a `Selector`
      Returns:
        true if the selection is accepted (for example it is movable), false if the selection will be discarded (for example it is pinned)

Copyright © 2006–2021 JBoss by Red Hat. All rights reserved.