segstore: add default unhandled methods to ISegmentStore
[deliverable/tracecompass.git] / statesystem / org.eclipse.tracecompass.segmentstore.core / src / org / eclipse / tracecompass / segmentstore / core / ISegmentStore.java
index 132f08a9a68f3178e1b285fe6d4720cf9af94c2f..c5779732bc43538149c80152874565e9c490358f 100644 (file)
@@ -22,9 +22,18 @@ import org.eclipse.jdt.annotation.NonNull;
 
 import com.google.common.collect.Lists;
 
+import org.eclipse.jdt.annotation.Nullable;
+
 /**
  * Interface for segment-storing backends.
  *
+ * Common contract (what should not be implemented) for a segment store.
+ * <ol>
+ * <li>no remove</li>
+ * <li>no removeAll</li>
+ * <li>no retainall</li>
+ * </ol>
+ *
  * @param <E>
  *            The type of {@link ISegment} element that will be stored in this
  *            database.
@@ -135,4 +144,19 @@ public interface ISegmentStore<E extends ISegment> extends Collection<E> {
     default void close(boolean deleteFiles) {
 
     }
+
+    @Override
+    default boolean remove(@Nullable Object o) {
+        throw new UnsupportedOperationException("Segment stores does not support \"remove\""); //$NON-NLS-1$
+    }
+
+    @Override
+    default boolean removeAll(@Nullable Collection<?> c) {
+        throw new UnsupportedOperationException("Segment stores does not support \"removeAll\""); //$NON-NLS-1$
+    }
+
+    @Override
+    default boolean retainAll(@Nullable Collection<?> c) {
+        throw new UnsupportedOperationException("Segment stores does not support \"retainAll\""); //$NON-NLS-1$
+    }
 }
This page took 0.026499 seconds and 5 git commands to generate.