Class Transformer.ForField

    • Constructor Detail

      • ForField

        public ForField​(Transformer<FieldDescription.Token> transformer)
        Creates a new simple field transformer.
        Parameters:
        transformer - The token transformer to apply to a transformed field.
    • Method Detail

      • withModifiers

        public static Transformer<FieldDescription> withModifiers​(ModifierContributor.ForField... modifierContributor)
        Creates a field transformer that patches the transformed field by the given modifier contributors.
        Parameters:
        modifierContributor - The modifier contributors to apply.
        Returns:
        A suitable field transformer.
      • withModifiers

        public static Transformer<FieldDescription> withModifiers​(java.util.List<? extends ModifierContributor.ForField> modifierContributors)
        Creates a field transformer that patches the transformed field by the given modifier contributors.
        Parameters:
        modifierContributors - The modifier contributors to apply.
        Returns:
        A suitable field transformer.
      • transform

        public FieldDescription transform​(TypeDescription instrumentedType,
                                          FieldDescription fieldDescription)
        Transforms the supplied target.
        Specified by:
        transform in interface Transformer<FieldDescription>
        Parameters:
        instrumentedType - The instrumented type that declares the target being transformed.
        fieldDescription - The target entity that is being transformed.
        Returns:
        The transformed instance.