import org.opendaylight.neutron.spi.INeutronObject;
public interface INeutronRequest<T extends INeutronObject<T>> {
+
default T getSingleton() {
- // return this.sinleton
+ // return this.singleton
Class<?> cls = getClass();
try {
Field field = cls.getDeclaredField("singleton");
}
default boolean isSingleton() {
- // return this.sinleton != null
- Class<?> cls = getClass();
- try {
- Field field = cls.getDeclaredField("singleton");
- return field.get(this) != null;
- } catch (IllegalAccessException | NoSuchFieldException e) {
- throw new IllegalArgumentException(e);
- }
+ return getSingleton() != null;
}
default List<T> getBulk() {