Package com.palantir.javaformat
Enum Class LastLevelBreakability
- All Implemented Interfaces:
Serializable,Comparable<LastLevelBreakability>,Constable
How to decide whether to break the last inner level ("this level") of a parent level with
BreakBehaviour.Cases.preferBreakingLastInnerLevel(boolean).-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDefault behaviour.Unconditionally allow ending an inline chain at this level, after which this level may be broken as usual, or a prefix thereof could be inlined further (if it has the appropriate break behaviour ofBreakBehaviour.Cases.preferBreakingLastInnerLevel(boolean)).Behaves likeACCEPT_INLINE_CHAINif the current inlined levels are all simple (according toOpenOp.complexity()), otherwise behave likeCHECK_INNER.Delegate to theLastLevelBreakabilityof _this_ level's last inner level. -
Method Summary
Modifier and TypeMethodDescriptionstatic LastLevelBreakabilityReturns the enum constant of this class with the specified name.static LastLevelBreakability[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ABORT
Default behaviour. When processing aBreakBehaviour.Cases.preferBreakingLastInnerLevel(boolean)chain, if we've arrived at a level with this breakability, then we should abort the chain. -
ACCEPT_INLINE_CHAIN
Unconditionally allow ending an inline chain at this level, after which this level may be broken as usual, or a prefix thereof could be inlined further (if it has the appropriate break behaviour ofBreakBehaviour.Cases.preferBreakingLastInnerLevel(boolean)). This should only be used when you know that the first non-LevelDocinside this level, if you flatten it, is aBreak. -
CHECK_INNER
Delegate to theLastLevelBreakabilityof _this_ level's last inner level. Typically, this will be true if this level is not immediately followed by a break (see StartsWithBreakVisitor). Behaves the same asABORTif this level is notBreakBehaviour.Cases.preferBreakingLastInnerLevel(boolean). -
ACCEPT_INLINE_CHAIN_IF_SIMPLE_OTHERWISE_CHECK_INNER
Behaves likeACCEPT_INLINE_CHAINif the current inlined levels are all simple (according toOpenOp.complexity()), otherwise behave likeCHECK_INNER.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-