@Override public String toString() { return getId(); } }
@Override public int hashCode() { return super.hashCode(); } }
public static AttributeParameter byName(String name) { return new AttributeParameter(name); } }
private Map<String, Serializable> getAttributes(AttributedType attributedType) { HashMap<String, Serializable> attributes = new HashMap<String, Serializable>(); for (Attribute attribute : attributedType.getAttributes()) { attributes.put(attribute.getName(), attribute.getValue()); } return attributes; } }
@Override public String getValue(Object instance) { if (!(instance instanceof AttributedType)) { throw new IllegalStateException("Instance [ " + instance + " ] not an instance of AttributedType"); } AttributedType attributedType = (AttributedType) instance; Attribute<String> attr = attributedType.getAttribute(bindingPropertyName); return attr!=null ? attr.getValue() : null; }
/** * <p>Return a formatted string representing the reference to the given {@link org.picketlink.idm.model.IdentityType}.</p> * * @param identityType * * @return */ public static String formatId(final IdentityType identityType) { return identityType.getClass().getName() + ID_SEPARATOR + identityType.getPartition().getId() + ID_SEPARATOR + identityType.getId(); }
@Override public void setValue(Object instance, String value) { if (!(instance instanceof AttributedType)) { throw new IllegalStateException("Instance [ " + instance + " ] not an instance of AttributedType"); } AttributedType attributedType = (AttributedType) instance; attributedType.setAttribute(new Attribute(bindingPropertyName, value)); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof Role)) { return false; } Role other = (Role) obj; // FIXME The Partition should also be taken into account. return other.getName() != null && this.getName() != null && other.getName().equals(this.getName()); } }
protected FilePermission(IdentityType identityType, Permission permission) { super(VERSION, permission); this.identityTypeId = identityType.getId(); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof Group)) { return false; } Group other = (Group) obj; // FIXME The Partition should also be taken into account return other.getId() != null && this.getId() != null && other.getId().equals(this.getId()); } }
public String getId() { if (id == null) { id = parentGroup == null ? String.format("/%s", this.name) : String.format("%s/%s", parentGroup.getId(), this.name); } return id; }
@Override public String getKey() { return String.format("%s%s", User.KEY_PREFIX, getId()); } }
private Map<String, Serializable> getAttributes(AttributedType attributedType) { HashMap<String, Serializable> attributes = new HashMap<String, Serializable>(); for (Attribute attribute : attributedType.getAttributes()) { attributes.put(attribute.getName(), attribute.getValue()); } return attributes; } }
@Override public String getValue(Object instance) { if (!(instance instanceof AttributedType)) { throw new IllegalStateException("Instance [ " + instance + " ] not an instance of AttributedType"); } AttributedType attributedType = (AttributedType) instance; Attribute<String> attr = attributedType.getAttribute(bindingPropertyName); return attr!=null ? attr.getValue() : null; }
/** * <p>Return a formatted string representing the reference to the given {@link org.picketlink.idm.model.IdentityType}.</p> * * @param identityType * * @return */ public static String formatId(final IdentityType identityType) { return identityType.getClass().getName() + ID_SEPARATOR + identityType.getPartition().getId() + ID_SEPARATOR + identityType.getId(); }
@Override public void setValue(Object instance, String value) { if (!(instance instanceof AttributedType)) { throw new IllegalStateException("Instance [ " + instance + " ] not an instance of AttributedType"); } AttributedType attributedType = (AttributedType) instance; attributedType.setAttribute(new Attribute(bindingPropertyName, value)); }
protected FilePermission(IdentityType identityType, Permission permission) { super(VERSION, permission); this.identityTypeId = identityType.getId(); }
@Override public String toString() { return getId(); } }
@Override public int hashCode() { return super.hashCode(); } }
private Map<String, Serializable> getAttributes(AttributedType attributedType) { HashMap<String, Serializable> attributes = new HashMap<String, Serializable>(); for (Attribute attribute : attributedType.getAttributes()) { attributes.put(attribute.getName(), attribute.getValue()); } return attributes; } }