public interface CopyPolicy<I>
Copy policy interface.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CopyPolicy<?>Default copy policy.static final CopyPolicy<?>Copy policy which always uses originals. -
Method Summary
Modifier and TypeMethodDescriptionstatic <I> CopyPolicy<I>compound(CopyPolicy<I>... policies) Returns compound or single policy depending on list size.static <I> CopyPolicy<I>compound(List<CopyPolicy<I>> policies) Returns compound or single policy depending on list size.static <I> CopyPolicy<I>constant(CopyAction action) Returns copy policy which always returns the same action.static <I> CopyPolicy<I>Returns default copy policy.Returns action to apply to an input, which may be type, field or something else.static <I> CopyPolicy<I>original()Returns copy policy which always uses originals.
-
Field Details
-
DEFAULT
Default copy policy. -
ORIGINAL
Copy policy which always uses originals.
-
-
Method Details
-
getAction
Returns action to apply to an input, which may be type, field or something else. Must return non-null value.- Parameters:
input- input object- Returns:
- copy action
-
constant
Returns copy policy which always returns the same action.- Type Parameters:
I- input object type- Parameters:
action- action- Returns:
- copy policy which always returns the same action
-
defaultPolicy
Returns default copy policy.- Type Parameters:
I- input object type- Returns:
- default copy policy
-
original
Returns copy policy which always uses originals.- Type Parameters:
I- input object type- Returns:
- copy policy which always uses originals
-
compound
Returns compound or single policy depending on list size. Compound copy policy searches for the first non-default action in the list of policies.- Type Parameters:
I- input type- Parameters:
policies- list of policies- Returns:
- compound or single policy
-
compound
Returns compound or single policy depending on list size. Compound copy policy searches for the first non-default action in the list of policies.- Type Parameters:
I- input type- Parameters:
policies- list of policies- Returns:
- compound or single policy
-