Module com.google.googlejavaformat
Package com.google.googlejavaformat.java
Record Class JavaFormatterOptions
java.lang.Object
java.lang.Record
com.google.googlejavaformat.java.JavaFormatterOptions
- Record Components:
style- Returns the code style.
@Immutable
public record JavaFormatterOptions(boolean formatJavadoc, boolean reorderModifiers, JavaFormatterOptions.Style style)
extends Record
Options for a google-java-format invocation.
Like gofmt, the google-java-format CLI exposes no configuration options (aside from
--aosp).
The goal of google-java-format is to provide consistent formatting, and to free developers from arguments over style choices. It is an explicit non-goal to support developers' individual preferences, and in fact it would work directly against our primary goals.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionJavaFormatterOptions(boolean formatJavadoc, boolean reorderModifiers, JavaFormatterOptions.Style style) Creates an instance of aJavaFormatterOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic JavaFormatterOptions.Builderbuilder()Returns a builder forJavaFormatterOptions.static JavaFormatterOptionsReturns the default formatting options.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of theformatJavadocrecord component.final inthashCode()Returns a hash code value for this object.intReturns the multiplier for the unit of indent.booleanReturns the value of thereorderModifiersrecord component.style()Returns the value of thestylerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
JavaFormatterOptions
public JavaFormatterOptions(boolean formatJavadoc, boolean reorderModifiers, JavaFormatterOptions.Style style) Creates an instance of aJavaFormatterOptionsrecord class.- Parameters:
formatJavadoc- the value for theformatJavadocrecord componentreorderModifiers- the value for thereorderModifiersrecord componentstyle- the value for thestylerecord component
-
-
Method Details
-
indentationMultiplier
public int indentationMultiplier()Returns the multiplier for the unit of indent. -
defaultOptions
Returns the default formatting options. -
builder
Returns a builder forJavaFormatterOptions. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
formatJavadoc
public boolean formatJavadoc()Returns the value of theformatJavadocrecord component.- Returns:
- the value of the
formatJavadocrecord component
-
reorderModifiers
public boolean reorderModifiers()Returns the value of thereorderModifiersrecord component.- Returns:
- the value of the
reorderModifiersrecord component
-
style
Returns the value of thestylerecord component.- Returns:
- the value of the
stylerecord component
-