Package com.diffplug.spotless
Class PaddedCell
java.lang.Object
com.diffplug.spotless.PaddedCell
Models the result of applying a
Formatter on a given File
while characterizing various failure modes (slow convergence, cycles, and divergence).
See check(Formatter, File) as the entry point to this class.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionReturns the "canonical" form for this particular result (only possible if isResolvable).static PaddedCellApplies the given formatter to the given file, checking that F(F(input)) == F(input).static PaddedCellstatic PaddedCellcheck(Formatter formatter, File file, String originalUnix, com.diffplug.spotless.ValuePerStep<Throwable> exceptionPerStep) file()Returns the file which was tested.booleanAny result which doesn't diverge can be resolved.booleanReturns true iff the formatter misbehaved in any way (did not converge after a single iteration).steps()Returns the steps it takes to get to the result.type()Returns the type of the result (eitherPaddedCell.Type.CONVERGE,PaddedCell.Type.CYCLE, orPaddedCell.Type.DIVERGE).Returns a string which describes this result.
-
Method Details
-
file
Returns the file which was tested. -
type
Returns the type of the result (eitherPaddedCell.Type.CONVERGE,PaddedCell.Type.CYCLE, orPaddedCell.Type.DIVERGE). -
steps
Returns the steps it takes to get to the result. -
check
Applies the given formatter to the given file, checking that F(F(input)) == F(input).If it meets this test,
misbehaved()will return false.If it fails the test,
misbehaved()will return true, and you can find out more about the misbehavior based on itsPaddedCell.Type. -
check
-
check
public static PaddedCell check(Formatter formatter, File file, String originalUnix, com.diffplug.spotless.ValuePerStep<Throwable> exceptionPerStep) -
misbehaved
public boolean misbehaved()Returns true iff the formatter misbehaved in any way (did not converge after a single iteration). -
isResolvable
public boolean isResolvable()Any result which doesn't diverge can be resolved. -
canonical
Returns the "canonical" form for this particular result (only possible if isResolvable). -
userMessage
Returns a string which describes this result.
-