
com.windowsazure.samples.blob.Permission Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jpa4azure Show documentation
Show all versions of jpa4azure Show documentation
jpa4azure, implements a subset of the JPA specification using Azure Storage for pesisting beans. see http://jpa4azure.codeplex.com for more information.
package com.windowsazure.samples.blob;
import java.util.EnumSet;
import java.util.Set;
public enum Permission {
READ,
WRITE,
DELETE;
public static final Set FULL = EnumSet.allOf(Permission.class);
public static Set fromRepresentation(String text) {
Set permissions = EnumSet.noneOf(Permission.class);
for (Permission permission : Permission.values()) {
char c = permission.getRepresentation().charAt(0);
if (text.toLowerCase().indexOf(c) != -1)
permissions.add(permission);
}
return permissions;
}
public static String getRepresentation(Set permissions) {
String representation = "";
for (Permission permission : permissions) {
representation += permission.getRepresentation();
}
return representation;
}
public String getRepresentation() {
return toString().substring(0, 1).toLowerCase();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy