Class MemberSubstitution.WithoutSpecification.ForMatchedField

    • Field Detail

      • matchRead

        private final boolean matchRead
        true if read access to a field should be substituted.
      • matchWrite

        private final boolean matchWrite
        true if write access to a field should be substituted.
    • Constructor Detail

      • ForMatchedField

        protected ForMatchedField​(MethodGraph.Compiler methodGraphCompiler,
                                  MemberSubstitution.TypePoolResolver typePoolResolver,
                                  boolean strict,
                                  MemberSubstitution.Replacement.Factory replacementFactory,
                                  ElementMatcher<? super FieldDescription.InDefinedShape> matcher)
        Creates a new member substitution for a matched field that requires a specification for how to perform a substitution.
        Parameters:
        methodGraphCompiler - The method graph compiler to use.
        typePoolResolver - The type pool resolver to use.
        strict - true if the method processing should be strict where an exception is raised if a member cannot be found.
        replacementFactory - The replacement factory to use.
        matcher - A matcher for any field that should be substituted.
      • ForMatchedField

        protected ForMatchedField​(MethodGraph.Compiler methodGraphCompiler,
                                  MemberSubstitution.TypePoolResolver typePoolResolver,
                                  boolean strict,
                                  MemberSubstitution.Replacement.Factory replacementFactory,
                                  ElementMatcher<? super FieldDescription.InDefinedShape> matcher,
                                  boolean matchRead,
                                  boolean matchWrite)
        Creates a new member substitution for a matched field that requires a specification for how to perform a substitution.
        Parameters:
        methodGraphCompiler - The method graph compiler to use.
        typePoolResolver - The type pool resolver to use.
        strict - true if the method processing should be strict where an exception is raised if a member cannot be found.
        replacementFactory - The replacement factory to use.
        matcher - A matcher for any field that should be substituted.
        matchRead - true if read access to a field should be substituted.
        matchWrite - true if write access to a field should be substituted.
    • Method Detail

      • onRead

        public MemberSubstitution.WithoutSpecification onRead()
        When invoked, only read access of the previously matched field is substituted.
        Returns:
        This instance with the limitation that only read access to the matched field is substituted.
      • onWrite

        public MemberSubstitution.WithoutSpecification onWrite()
        When invoked, only write access of the previously matched field is substituted.
        Returns:
        This instance with the limitation that only write access to the matched field is substituted.