All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nhl.link.rest.runtime.constraints.DefaultEntityConstraint Maven / Gradle / Ivy

package com.nhl.link.rest.runtime.constraints;

import java.util.Set;

import com.nhl.link.rest.EntityConstraint;

/**
 * @since 1.6
 */
class DefaultEntityConstraint implements EntityConstraint {

	private String entityName;
	private boolean allowsId;
	private boolean allowsAllAttributes;
	private Set attributes;
	private Set relationships;

	DefaultEntityConstraint(String entityName, boolean allowsId, boolean allowsAllAttributes, Set attributes,
			Set relationships) {
		this.entityName = entityName;
		this.allowsId = allowsId;
		this.attributes = attributes;
		this.relationships = relationships;
		this.allowsAllAttributes = allowsAllAttributes;
	}

	@Override
	public String getEntityName() {
		return entityName;
	}

	@Override
	public boolean allowsId() {
		return allowsId;
	}

	@Override
	public boolean allowsAllAttributes() {
		return allowsAllAttributes;
	}

	@Override
	public boolean allowsAttribute(String name) {
		return attributes.contains(name);
	}

	@Override
	public boolean allowsRelationship(String name) {
		return relationships.contains(name);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy