// Path: src/main/java/org/jacis/plugin/readonly/object/JacisReadonlyModeSupport.java
// @JacisApi
// public interface JacisReadonlyModeSupport {
// 
//   /**
//    * Switches the object into the read-only mode
//    */
//   void switchToReadOnlyMode();
// 
//   /**
//    * Switches the object into the read-write mode
//    */
//   void switchToReadWriteMode();
// 
//   /**
//    * @return if the object is currently in the read-only mode
//    */
//   boolean isReadOnly();
// 
//   /**
//    * @return if the object is writable for the current thread
//    */
//   boolean isWritable();
// 
//   /**
//    * Switches the read / write mode depending on the passed parameter
//    *
//    * @param readOnlyMode if 'true' switch to read-only mode, if 'false' switch to read-write mode
//    */
//   default void switchToReadOnlyMode(boolean readOnlyMode) {
//     if (readOnlyMode) {
//       switchToReadOnlyMode();
//     } else {
//       switchToReadWriteMode();
//     }
//   }
// 
// }


import org.jacis.plugin.readonly.object.JacisReadonlyModeSupport;
/*
 * Copyright (c) 2016. Jan Wiemer
 */

package org.jacis.plugin.readonly;


/**
 * The default implementation of the interface {@link JacisStoreEntryReadOnlyModeAdapter}.
 * This implementation is applicable for objects
 * implementing the {@link org.jacis.plugin.readonly.object.JacisReadonlyModeSupport} interface
 * and uses the methods declared in this interface for switching the mode.
 *
 * @param <V> The type of the values that should be switched between read-write and read-only mode.
 * @author Jan Wiemer
 */
public class DefaultJacisStoreEntryReadOnlyModeAdapter<V> implements JacisStoreEntryReadOnlyModeAdapter<V> {

  @Override
  public boolean isApplicableTo(V value) {
// Path: src/main/java/org/jacis/plugin/readonly/object/JacisReadonlyModeSupport.java
// @JacisApi
// public interface JacisReadonlyModeSupport {
// 
//   /**
//    * Switches the object into the read-only mode
//    */
//   void switchToReadOnlyMode();
// 
//   /**
//    * Switches the object into the read-write mode
//    */
//   void switchToReadWriteMode();
// 
//   /**
//    * @return if the object is currently in the read-only mode
//    */
//   boolean isReadOnly();
// 
//   /**
//    * @return if the object is writable for the current thread
//    */
//   boolean isWritable();
// 
//   /**
//    * Switches the read / write mode depending on the passed parameter
//    *
//    * @param readOnlyMode if 'true' switch to read-only mode, if 'false' switch to read-write mode
//    */
//   default void switchToReadOnlyMode(boolean readOnlyMode) {
//     if (readOnlyMode) {
//       switchToReadOnlyMode();
//     } else {
//       switchToReadWriteMode();
//     }
//   }
// 
// }


// Path: src/main/java/org/jacis/plugin/readonly/DefaultJacisStoreEntryReadOnlyModeAdapter.java
import org.jacis.plugin.readonly.object.JacisReadonlyModeSupport;

/*
 * Copyright (c) 2016. Jan Wiemer
 */

package org.jacis.plugin.readonly;


/**
 * The default implementation of the interface {@link JacisStoreEntryReadOnlyModeAdapter}.
 * This implementation is applicable for objects
 * implementing the {@link org.jacis.plugin.readonly.object.JacisReadonlyModeSupport} interface
 * and uses the methods declared in this interface for switching the mode.
 *
 * @param <V> The type of the values that should be switched between read-write and read-only mode.
 * @author Jan Wiemer
 */
public class DefaultJacisStoreEntryReadOnlyModeAdapter<V> implements JacisStoreEntryReadOnlyModeAdapter<V> {

  @Override
  public boolean isApplicableTo(V value) {
    return value instanceof JacisReadonlyModeSupport;