@SuppressWarnings("unchecked") public static <T> ImmutableList<T> create(T... values) { if (values.length == 0) return (ImmutableList<T>) EMPTY; return new ImmutableList<T>(Arrays.asList(values)); }
@SuppressWarnings("unchecked") public static <T> ImmutableList<T> copyOf(List<T> values) { if (values == null) return (ImmutableList<T>) EMPTY; if (values instanceof ImmutableList) return (ImmutableList<T>) values; return (ImmutableList<T>) create(values.toArray()); }
@Override public boolean addAll(Collection<? extends T> paramCollection) { throw newModificationUnsupported(); }
public PreparedStatement asPreparedStatement(Connection conn) throws SQLException { PreparedStatement stmt = conn.prepareStatement(sql); for (int i = 0; i < params.size(); i++) { SqlParameter p = params.get(i); if (p.sqlType == null) { stmt.setObject(i + 1, p.value); } else { stmt.setObject(i + 1, p.value, p.sqlType); } } return stmt; }
public EdmReferentialConstraint build() { return new EdmReferentialConstraint(principalRole, dependentRole, ImmutableList.copyOf(principalReferences), ImmutableList.copyOf(dependentReferences), getDocumentation(), ImmutableList.copyOf(getAnnotations()), ImmutableList.copyOf(getAnnotationElements())); }
private EdmEntityType(String namespace, String alias, String name, Boolean hasStream, Boolean openType, ImmutableList<String> keys, EdmEntityType baseType, List<EdmProperty.Builder> properties, ImmutableList<EdmNavigationProperty> navigationProperties, EdmDocumentation doc, ImmutableList<EdmAnnotation<?>> annotations, ImmutableList<EdmAnnotation<?>> annotElements, Boolean isAbstract) { super(baseType, namespace, name, properties, doc, annotations, annotElements, isAbstract); this.alias = alias; this.hasStream = hasStream; this.openType = openType; this.keys = (keys == null || keys.isEmpty()) ? (baseType == null ? findConventionalKeys() : null) : keys; if (baseType == null && this.keys == null) throw new IllegalArgumentException("Root types must have keys"); if (baseType != null && this.keys != null) throw new IllegalArgumentException("Keys on root types only"); this.navigationProperties = navigationProperties; }
private EdmEntityType(String namespace, String alias, String name, Boolean hasStream, Boolean openType, ImmutableList<String> keys, EdmEntityType baseType, List<EdmProperty.Builder> properties, ImmutableList<EdmNavigationProperty> navigationProperties, EdmDocumentation doc, ImmutableList<EdmAnnotation<?>> annotations, ImmutableList<EdmAnnotation<?>> annotElements, Boolean isAbstract) { super(baseType, namespace, name, properties, doc, annotations, annotElements, isAbstract); this.alias = alias; this.hasStream = hasStream; this.openType = openType; this.keys = (keys == null || keys.isEmpty()) ? (baseType == null ? findConventionalKeys() : null) : keys; if (baseType == null && this.keys == null) throw new IllegalArgumentException("Root types must have keys"); if (baseType != null && this.keys != null) throw new IllegalArgumentException("Keys on root types only"); this.navigationProperties = navigationProperties; }
public EdmReferentialConstraint build() { return new EdmReferentialConstraint(principalRole, dependentRole, ImmutableList.copyOf(principalReferences), ImmutableList.copyOf(dependentReferences), getDocumentation(), ImmutableList.copyOf(getAnnotations()), ImmutableList.copyOf(getAnnotationElements())); }
@Override public boolean addAll(Collection<? extends T> paramCollection) { throw newModificationUnsupported(); }
private EdmEntityType(String namespace, String alias, String name, Boolean hasStream, Boolean openType, ImmutableList<String> keys, EdmEntityType baseType, List<EdmProperty.Builder> properties, ImmutableList<EdmNavigationProperty> navigationProperties, EdmDocumentation doc, ImmutableList<EdmAnnotation<?>> annotations, ImmutableList<EdmAnnotation<?>> annotElements, Boolean isAbstract) { super(baseType, namespace, name, properties, doc, annotations, annotElements, isAbstract); this.alias = alias; this.hasStream = hasStream; this.openType = openType; this.keys = (keys == null || keys.isEmpty()) ? (baseType == null ? findConventionalKeys() : null) : keys; if (baseType == null && this.keys == null) throw new IllegalArgumentException("Root types must have keys"); if (baseType != null && this.keys != null) throw new IllegalArgumentException("Keys on root types only"); this.navigationProperties = navigationProperties; }
@SuppressWarnings("unchecked") public static <T> ImmutableList<T> create(T... values) { if (values.length == 0) return (ImmutableList<T>) EMPTY; return new ImmutableList<T>(Arrays.asList(values)); }
@SuppressWarnings("unchecked") public static <T> ImmutableList<T> copyOf(List<T> values) { if (values == null) return (ImmutableList<T>) EMPTY; if (values instanceof ImmutableList) return (ImmutableList<T>) values; return (ImmutableList<T>) create(values.toArray()); }
public EdmReferentialConstraint build() { return new EdmReferentialConstraint(principalRole, dependentRole, ImmutableList.copyOf(principalReferences), ImmutableList.copyOf(dependentReferences), getDocumentation(), ImmutableList.copyOf(getAnnotations()), ImmutableList.copyOf(getAnnotationElements())); }
@Override public void clear() { throw newModificationUnsupported(); }
private EdmEntitySet getEntitySet() { EdmEntitySet entitySet = null; if (!metadata.getSchemas().isEmpty()) { entitySet = metadata.findEdmEntitySet(entitySetName); if (entitySet == null) { // panic! could not determine the entity-set, is it a function? EdmFunctionImport efi = metadata.findEdmFunctionImport(entitySetName); if (efi != null) entitySet = efi.getEntitySet(); } } if (entitySet == null) throw new RuntimeException("Could not derive the entity-set " + entitySetName); return entitySet; }
@SuppressWarnings("unchecked") public static <T> ImmutableList<T> create(T... values) { if (values.length == 0) return (ImmutableList<T>) EMPTY; return new ImmutableList<T>(Arrays.asList(values)); }
@SuppressWarnings("unchecked") public static <T> ImmutableList<T> copyOf(List<T> values) { if (values == null) return (ImmutableList<T>) EMPTY; if (values instanceof ImmutableList) return (ImmutableList<T>) values; return (ImmutableList<T>) create(values.toArray()); }
@Override public T remove(int paramInt) { throw newModificationUnsupported(); }