Package com.palantir.javaformat
Class OpenOp
java.lang.Object
com.palantir.javaformat.doc.HasUniqueId
com.palantir.javaformat.OpenOp
- All Implemented Interfaces:
Op
An
OpenOp opens a level. It is an Op in the sequence of Ops generated by OpsBuilder.
When the sequence is turned into a Doc by DocBuilder, Input.Toks delimited by
OpenOp-CloseOp pairs turn into nested Levels.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(DocBuilder builder) Add anOpto aDocBuilder.If it's the last level of its parent, when to inline this level rather than break the parent.When this level doesn't fit on one line, controls whether this level is to be broken (its breaks taken) or partially inlined onto the current line.static OpenOp.Builderbuilder()abstract OptionalIntCustom max column limit that contents of this level before the last break may not exceed.A level is "simple" if it doesn't have multiple parameters (in the case of a method call), or multiple chained method calls.static OpMake an ordinaryOpenOp.abstract IndentThe extra indent inside this level.Methods inherited from class com.palantir.javaformat.doc.HasUniqueId
id
-
Constructor Details
-
OpenOp
public OpenOp()
-
-
Method Details
-
plusIndent
The extra indent inside this level. -
breakBehaviour
When this level doesn't fit on one line, controls whether this level is to be broken (its breaks taken) or partially inlined onto the current line. -
breakabilityIfLastLevel
If it's the last level of its parent, when to inline this level rather than break the parent. -
partialInlineability
-
complexity
A level is "simple" if it doesn't have multiple parameters (in the case of a method call), or multiple chained method calls.This is used to poison the ability to partially inline method arguments down the line if a parent level was too complicated, so that you can't end up with this:
method(arg1, arg2, arg3.foo().stream() .filter(...) .map(...));orlog.info("Message", exception, SafeArg.of( "foo", foo);But you can still get this (see test B20128760):Stream
or this:itemIdsStream = stream(members).flatMap(m -> m.getFieldValues().entrySet().stream() .filter(...) .map(...)); method(anotherMethod(arg3.foo().stream() .filter(...) .map(...)));or this:method(anotherMethod( ...)); // long arguments -
debugName
-
columnLimitBeforeLastBreak
Custom max column limit that contents of this level before the last break may not exceed. -
make
Make an ordinaryOpenOp.- See Also:
-
add
Description copied from interface:OpAdd anOpto aDocBuilder.- Specified by:
addin interfaceOp- Parameters:
builder- theDocBuilder
-
builder
- See Also:
-
Builder()
-