/** * Constructs a new {@code LazyListIterator}. * * @param containingList the containing list * @param modCount the function to retrieve the modification count of the containing list * @param index the starting index */ public LazyListIterator(L containingList, IntSupplier modCount, int index) { super(containingList, modCount); checkPositionIndex(index, index == 0 ? 0 : size.getAsInt()); this.cursor = index; }
/** * Constructs a new {@code AbstractUriFactory} with the given {@code scheme}. * * @param scheme the scheme to identify the {@link fr.inria.atlanmod.neoemf.data.BackendFactory} to use * @param supportsLocal {@code true} if file-based URIs are supported * @param supportsRemote {@code true} if server-based URIs are supported */ protected AbstractUriFactory(String scheme, boolean supportsLocal, boolean supportsRemote) { this.scheme = Lazy.of(checkNotNull(scheme, "Cannot create URI without a valid scheme")); this.supportsLocal = supportsLocal; this.supportsRemote = supportsRemote; }
/** * Constructs a {@code PersistentResourceDecorator} on the given {@code resource}. * * @param resource the underlying resource */ public PersistentResourceDecorator(PersistentResource resource) { this.resource = checkNotNull(resource, "resource"); }
@Nonnull @Override public BasicNamespace setReal(EPackage ePackage) { checkNotNull(ePackage, "ePackage"); this.ePackage.update(ePackage); return this; }
/** * Ensures that the specified element has been created in the graph. * * @param e the element to test */ private void checkNativeElement(final Element e) { checkInstanceOf(e, IdElement.class, "Given element was not created in this graph"); }
@Override public EPackage getReal() { return ePackage.get(); }
@Override public final boolean hasNext() { return cursor < size.getAsInt(); }
/** * Removes the {@code values} in the {@link org.eclipse.emf.ecore.EObject#eGet(EStructuralFeature, boolean) content} * of the object's feature. * * @param internalObject the object in question * @param feature a {@link org.eclipse.emf.ecore.ETypedElement#isMany() many-valued} feature of the object * @param values the values to remove */ // TODO Implement this method default void removeAll(InternalEObject internalObject, EStructuralFeature feature, Collection<?> values) { throw Throwables.notImplementedYet("removeAll"); }
/** * Constructs a new {@code PersistentStoreAdapter} on the given {@code store}. * * @param store the inner store * @param resource the resource to store and access */ public PersistentStoreAdapter(Store store, PersistentResource resource) { super(store, checkNotNull(resource, "resource")); }
/** * Ensures that the base graph is indexable. */ private void checkIndexableGraph() { checkInstanceOf(baseGraph, IndexableGraph.class, "The base graph is not an indexable graph"); }
@Override public PersistentEObject eInternalContainer() { return lazyContainer.get(); }
@Override public int getHash() { return lazyHash.getAsInt(); }
/** * Constructs a new {@code SerializerDecorator} on the specified {@code delegate}. * * @param delegate the serializer where to delegate the serialization process */ public SerializerDecorator(BinarySerializer<T> delegate) { checkNotNull(delegate, "delegate"); this.delegate = delegate; }
/** * Constructs a new {@code AbstractBasedObject}. * * @param base the base element */ protected AbstractBasedObject(T base) { this.base = checkNotNull(base, "base"); }
/** * Constructs a new {@code InvalidDataMapper} with the exception thrown when calling unsupported methods. * * @param e the exception thrown when calling unsupported methods */ public InvalidDataMapper(Supplier<RuntimeException> e) { this.e = checkNotNull(e, "e"); }
/** * Constructs a new {@code Node} with the given {@code name}. * * @param name the name of this node */ public Node(String name) { this.name = checkNotNull(name, "name"); }
/** * Constructs a new {@code DefaultPersistentEObject} with the given {@code id}. * * @param id the identifier of this object */ protected DefaultPersistentEObject(Id id) { this.id = checkNotNull(id, "id"); }
/** * Checks the specified {@code feature} before using it. * * @param feature the feature to check */ protected void checkFeature(FeatureBean feature) { checkNotNull(feature, "feature"); }
/** * Defines the next mapper to notify. * * @param next the next mapper */ protected void next(M next) { this.next = checkNotNull(next, "next"); }
@Override public R getReal() { return checkNotNull(eFeature, "eFeature"); }