Object#toString() that concatenates the String representation of all fields that are declared by a class.
| Modifier and Type | Class and Description |
|---|---|
| protected static class | ToStringMethod.Appender
An appender to implement |
| public static interface | ToStringMethod.PrefixResolver
A prefix resolver is responsible for providing a value that is prepended to a |
| protected static enum | ToStringMethod.ValueConsumer
A value consumer that is responsible for adding a field value to the string creating |
| Modifier and Type | Field and Description |
|---|---|
| private final String | definer
A token that is added between a field's name and its value. |
| private final String | end
A token that is added after the last field value. |
| private final ElementMatcher. | ignored
A filter that determines what fields to ignore. |
| private final ToStringMethod. | prefixResolver
A resolver for the prefix of a |
| private final String | separator
A token that is added between two field values. |
| private final String | start
A token that is added between the prefix and the first field value. |
| private static final MethodDescription. | STRING_BUILDER_CONSTRUCTOR
The |
| private static final MethodDescription. | TO_STRING
The |
| Access | Constructor and Description |
|---|---|
| protected | ToStringMethod(ToStringMethod.
A resolver for the prefix of a prefixResolverString representation.Creates a new |
| private | ToStringMethod(ToStringMethod.
A resolver for the prefix of a prefixResolver,String representation.A token that is added between the prefix and the first field value. start, String A token that is added after the last field value. end, String A token that is added between two field values. separator, String A token that is added between a field's name and its value. definer, ElementMatcher.A filter that determines what fields to ignore. ignoredCreates a new |
| Modifier and Type | Method and Description |
|---|---|
| public ToStringMethod. | appender(Implementation.
The target of the current implementation. implementationTargetImplements net. |
| public static ToStringMethod | Returns: AObject#toString() implementation that is prefixed by the supplied string.The prefix to use. prefix)Creates a |
| public static ToStringMethod | Returns: AObject#toString() implementation that is prefixed by the string that is supplied by the given prefix resolver.The prefix resolver to use. prefixResolverCreates a |
| public static ToStringMethod | Returns: AObject#toString() implementation that is prefixed by the canonical class name of the instrumented type.Creates a |
| public static ToStringMethod | Returns: AObject#toString() implementation that is prefixed by the fully qualified class name of the instrumented type.Creates a |
| public static ToStringMethod | Returns: AObject#toString() implementation that is prefixed by the simple class name of the instrumented type.Creates a |
| public InstrumentedType | prepare(InstrumentedType
The instrumented type in its current form. instrumentedType)Implements net. |
| public ToStringMethod | Returns: A new version of this toString method implementation that also ignores any fields matched by the provided matcher.A matcher to specify any fields that should be ignored. ignored)Returns a new version of this toString method implementation that ignores the specified fields additionally to any previously specified fields. |
| public Implementation | Returns: A new instance of this implementation that uses the supplied tokens.A token that is added between the prefix and the first field value. start, String A token that is added after the last field value. end, String A token that is added between two field values. separator, String A token that is added between two field values. definer)Changes the tokens used for the |
| definer | back to summary |
|---|---|
| private final String definer A token that is added between a field's name and its value. | |
| end | back to summary |
|---|---|
| private final String end A token that is added after the last field value. | |
| ignored | back to summary |
|---|---|
| private final ElementMatcher. A filter that determines what fields to ignore. | |
| prefixResolver | back to summary |
|---|---|
| private final ToStringMethod. A resolver for the prefix of a | |
| separator | back to summary |
|---|---|
| private final String separator A token that is added between two field values. | |
| start | back to summary |
|---|---|
| private final String start A token that is added between the prefix and the first field value. | |
| STRING_BUILDER_CONSTRUCTOR | back to summary |
|---|---|
| private static final MethodDescription. The | |
| TO_STRING | back to summary |
|---|---|
| private static final MethodDescription. The | |
| ToStringMethod | back to summary |
|---|---|
| protected ToStringMethod(ToStringMethod. Creates a new
| |
| ToStringMethod | back to summary |
|---|---|
| private ToStringMethod(ToStringMethod. Creates a new
| |
| appender | back to summary |
|---|---|
| public ToStringMethod. Implements net. Doc from net. Creates a byte code appender that determines the implementation of the instrumented type's methods.
| |
| prefixedBy | back to summary |
|---|---|
| public static ToStringMethod prefixedBy(String prefix) Creates a
| |
| prefixedBy | back to summary |
|---|---|
| public static ToStringMethod prefixedBy(ToStringMethod. Creates a
| |
| prefixedByCanonicalClassName | back to summary |
|---|---|
| public static ToStringMethod prefixedByCanonicalClassName() Creates a
| |
| prefixedByFullyQualifiedClassName | back to summary |
|---|---|
| public static ToStringMethod prefixedByFullyQualifiedClassName() Creates a
| |
| prefixedBySimpleClassName | back to summary |
|---|---|
| public static ToStringMethod prefixedBySimpleClassName() Creates a
| |
| prepare | back to summary |
|---|---|
| public InstrumentedType prepare(InstrumentedType instrumentedType) Implements net. Doc from net. Prepares a given instrumented type.
| |
| withIgnoredFields | back to summary |
|---|---|
| public ToStringMethod withIgnoredFields(ElementMatcher<? super FieldDescription. Returns a new version of this toString method implementation that ignores the specified fields additionally to any previously specified fields.
| |
| withTokens | back to summary |
|---|---|
| public Implementation withTokens(String start, String end, String separator, String definer) Changes the tokens used for the
| |
ToStringMethod.
| Modifier and Type | Field and Description |
|---|---|
| private final String | definer
A token that is added between a field's name and its value. |
| private final String | end
A token that is added after the last field value. |
| private final List | fieldDescriptions
The list of fields to include in the |
| private final String | prefix
The prefix to use. |
| private final String | separator
A token that is added between two field values. |
| private final String | start
A token that is added between the prefix and the first field value. |
| Access | Constructor and Description |
|---|---|
| protected | Appender(String
The prefix to use. prefix, String A token that is added between the prefix and the first field value. start, String A token that is added after the last field value. end, String A token that is added between two field values. separator, String A token that is added between a field's name and its value. definer, List<? extends FieldDescription.The list of fields to include in the fieldDescriptions)Object#toString() implementation.Creates a new appender. |
| Modifier and Type | Method and Description |
|---|---|
| public ByteCodeAppender. | apply(MethodVisitor
The method visitor to which the byte code appender writes its code to. methodVisitor, Implementation.The implementation context of the current type creation process. implementationContext,The method that is the target of the instrumentation. instrumentedMethod)Implements net. |
| definer | back to summary |
|---|---|
| private final String definer A token that is added between a field's name and its value. | |
| end | back to summary |
|---|---|
| private final String end A token that is added after the last field value. | |
| fieldDescriptions | back to summary |
|---|---|
| private final List<? extends FieldDescription. The list of fields to include in the | |
| prefix | back to summary |
|---|---|
| private final String prefix The prefix to use. | |
| separator | back to summary |
|---|---|
| private final String separator A token that is added between two field values. | |
| start | back to summary |
|---|---|
| private final String start A token that is added between the prefix and the first field value. | |
| Appender | back to summary |
|---|---|
| protected Appender(String prefix, String start, String end, String separator, String definer, List<? extends FieldDescription. Creates a new appender.
| |
| apply | back to summary |
|---|---|
| public ByteCodeAppender. Implements net. Doc from net. Applies this byte code appender to a type creation process.
| |
Object#toString() implementation.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | ToStringMethod.PrefixResolver.Default
Default implementations for a prefix resolver. |
| public static class | ToStringMethod.PrefixResolver.ForFixedValue
A prefix resolver that returns a fixed value. |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: The value to be prefixed.The instrumented type. instrumentedType)Resolves the prefixed value. |
| resolve | back to summary |
|---|---|
| public String resolve(TypeDescription instrumentedType) Resolves the prefixed value.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final ToStringMethod. | CANONICAL_CLASS_NAME
A prefix resolver for the instrumented type's fully qualified class name. |
| public static final ToStringMethod. | FULLY_QUALIFIED_CLASS_NAME
A prefix resolver for the instrumented type's fully qualified class name. |
| public static final ToStringMethod. | SIMPLE_CLASS_NAME
A prefix resolver for the instrumented type's simple class name. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ToStringMethod. | |
| public static ToStringMethod. |
| CANONICAL_CLASS_NAME | back to summary |
|---|---|
| public static final ToStringMethod. A prefix resolver for the instrumented type's fully qualified class name. | |
| FULLY_QUALIFIED_CLASS_NAME | back to summary |
|---|---|
| public static final ToStringMethod. A prefix resolver for the instrumented type's fully qualified class name. | |
| SIMPLE_CLASS_NAME | back to summary |
|---|---|
| public static final ToStringMethod. A prefix resolver for the instrumented type's simple class name. | |
| Default | back to summary |
|---|---|
| private Default() | |
| valueOf | back to summary |
|---|---|
| public static ToStringMethod. | |
| values | back to summary |
|---|---|
| public static ToStringMethod. | |
| Modifier and Type | Field and Description |
|---|---|
| private final String | prefix
The prefix to prepend. |
| Access | Constructor and Description |
|---|---|
| protected | ForFixedValue(String
The prefix to prepend. prefix)Creates a new prefix resolver that returns a fixed value. |
| Modifier and Type | Method and Description |
|---|---|
| public String | resolve(TypeDescription
The instrumented type. instrumentedType)Implements net. |
| prefix | back to summary |
|---|---|
| private final String prefix The prefix to prepend. | |
| ForFixedValue | back to summary |
|---|---|
| protected ForFixedValue(String prefix) Creates a new prefix resolver that returns a fixed value.
| |
| resolve | back to summary |
|---|---|
| public String resolve(TypeDescription instrumentedType) Implements net. Doc from net. Resolves the prefixed value.
| |
StringBuilder.
| Modifier and Type | Field and Description |
|---|---|
| public static final ToStringMethod. | BOOLEAN
A value consumer for a |
| public static final ToStringMethod. | BOOLEAN_ARRAY
A value consumer for a |
| public static final ToStringMethod. | BYTE_ARRAY
A value consumer for a |
| public static final ToStringMethod. | CHARACTER
A value consumer for a |
| public static final ToStringMethod. | CHARACTER_ARRAY
A value consumer for a |
| public static final ToStringMethod. | CHARACTER_SEQUENCE
A value consumer for a |
| public static final ToStringMethod. | DOUBLE
A value consumer for a |
| public static final ToStringMethod. | DOUBLE_ARRAY
A value consumer for a |
| public static final ToStringMethod. | FLOAT
A value consumer for a |
| public static final ToStringMethod. | FLOAT_ARRAY
A value consumer for a |
| public static final ToStringMethod. | INTEGER
A value consumer for an |
| public static final ToStringMethod. | INTEGER_ARRAY
A value consumer for an |
| public static final ToStringMethod. | LONG
A value consumer for a |
| public static final ToStringMethod. | LONG_ARRAY
A value consumer for a |
| public static final ToStringMethod. | NESTED_ARRAY
A value consumer for a nested array type. |
| public static final ToStringMethod. | OBJECT
A value consumer for a reference type. |
| public static final ToStringMethod. | REFERENCE_ARRAY
A value consumer for a reference array type. |
| public static final ToStringMethod. | SHORT_ARRAY
A value consumer for a |
| public static final ToStringMethod. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | isValid()
Implements net. |
| protected static StackManipulation | Returns: An appropriate stack manipulation.The type for which to resolve a value resolver. typeDescription)Resolves an appropriate value resolver for a given type. |
| public static ToStringMethod. | |
| public static ToStringMethod. |
| BOOLEAN | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a | |
| BOOLEAN_ARRAY | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a | |
| BYTE_ARRAY | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a | |
| CHARACTER | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a | |
| CHARACTER_ARRAY | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a | |
| CHARACTER_SEQUENCE | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a | |
| DOUBLE | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a | |
| DOUBLE_ARRAY | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a | |
| FLOAT | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a | |
| FLOAT_ARRAY | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a | |
| INTEGER | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for an | |
| INTEGER_ARRAY | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for an | |
| LONG | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a | |
| LONG_ARRAY | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a | |
| NESTED_ARRAY | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a nested array type. | |
| OBJECT | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a reference type. | |
| REFERENCE_ARRAY | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a reference array type. | |
| SHORT_ARRAY | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a | |
| STRING | back to summary |
|---|---|
| public static final ToStringMethod. A value consumer for a | |
| ValueConsumer | back to summary |
|---|---|
| private ValueConsumer() | |
| isValid | back to summary |
|---|---|
| public boolean isValid() Implements net. Doc from net. Determines if this stack manipulation is valid.
| |
| of | back to summary |
|---|---|
| protected static StackManipulation of(TypeDescription typeDescription) Resolves an appropriate value resolver for a given type.
| |
| valueOf | back to summary |
|---|---|
| public static ToStringMethod. | |
| values | back to summary |
|---|---|
| public static ToStringMethod. | |