Skip to content
Snippets Groups Projects
Lens.java 508 B
Newer Older
  • Learn to ignore specific revisions
  • Guyslain's avatar
    Guyslain committed
    package model;
    
    Guyslain's avatar
    Guyslain committed
    
    
    /**
     * A lens interface representing a view into a mutable state.
     *
     * @param <S> The type of the value stored in the lens.
     */
    
    Guyslain's avatar
    Guyslain committed
    public interface Lens<S> {
    
        /**
         * Gets the value from the {@link Lens}.
         *
         * @return The value stored in the place designated by {@link Lens}.
         */
    
    Guyslain's avatar
    Guyslain committed
        S get();
    
    
        /**
         * Sets a new value into the {@link Lens}.
         *
         * @param value The new value to set in the place designated by the {@link Lens}.
         */
    
    Guyslain's avatar
    Guyslain committed
        void set(S value);
    }