Class RememberState

    • Constructor Detail

      • RememberState

        public RememberState()
    • Method Detail

      • rememberState

        public void rememberState()
        Remembers state of fields marked with StateField annotation. Objects that implement Cloneable interface as well as some common objects, like String, Integer, Long, List, Map, Set and so on are supported.
        Specified by:
        rememberState in interface StatefulObject
      • forgetState

        public void forgetState()
        Call this method to clear the remembered state
      • isStateModified

        public boolean isStateModified()
        Returns true if state of the fields marked with StateField annotation has changed.
        Specified by:
        isStateModified in interface StatefulObject
        Returns:
        true if state has changed
      • isFieldModified

        public boolean isFieldModified​(@NotNull
                                       Field field)
        Returns true if specified field was modified
        Parameters:
        field - field to check
        Returns:
        true if field value was modified
      • normalizeLineFeeds

        protected String normalizeLineFeeds​(String str)
      • findField

        @Nullable
        public Field findField​(@NotNull
                               String name)
        Locates field by name in current class and in superclasses
        Parameters:
        name - name of the field
        Returns:
        field or null
      • getField

        @NotNull
        public Field getField​(@NotNull
                              String name)
        Locates field by name in current class and in superclasses
        Parameters:
        name - name of the field
        Since:
        10.0
      • getRememberedState

        public <T> T getRememberedState​(@NotNull
                                        String fieldName)