/** * Construct an attribute using the given key and value. * * @param key the key to this attribute, contains the id and datatype. * @param value the attribute value * @throws IllegalArgumentException if the key is invalid for the * value (incompatible datatype). * @throws NullPointerException if the key or value is null */ Attribute(AttributeKey<?> key, Object value) { this.key = Preconditions.checkNotNull(key, "key"); setValue(value); }
/** * Construct an attribute using the given key and value. * * @param key the key to this attribute, contains the id and datatype. * @param value the attribute value * @throws IllegalArgumentException if the key is invalid for the * value (incompatible datatype). * @throws NullPointerException if the key or value is null */ Attribute(AttributeKey<?> key, Object value) { this.key = Preconditions.checkNotNull(key, "key"); setValue(value); }
/** * Construct an attribute using the given key and value. * * @param key the key to this attribute, contains the id and datatype. * @param value the attribute value * @throws IllegalArgumentException if the key is invalid for the * value (incompatible datatype). * @throws NullPointerException if the key or value is null */ Attribute(AttributeKey<?> key, Object value) { this.key = Preconditions.checkNotNull(key, "key"); setValue(value); }