- public static <T extends INeutronObject> INeutronRequest createRequest(Integer limit, String marker,
+ private static final class MarkerObject implements INeutronObject {
+ private final String id;
+
+ MarkerObject(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public String getID() {
+ return id;
+ }
+
+ @Override
+ public void setID(String id) {
+ throw new UnsupportedOperationException("Marker has constant ID");
+ }
+ }
+
+ /*
+ * SuppressWarnings is needed because the compiler does not understand that we
+ * are actually safe here.
+ *
+ * FIXME: the only caller performs a cast back, so this is not actually necessary.
+ */
+ @SuppressWarnings("unchecked")
+ public static <T extends INeutronObject> INeutronRequest<T> createRequest(Integer limit, String marker,