package uk.ac.vamsas.objects.utils; import uk.ac.vamsas.objects.core.Property; public class Properties { public static Property newProperty(String name, String type, String content) { Property vProperty = new Property(); vProperty.setName(name); if (type != null) { vProperty.setType(type); } else { vProperty.setType(STRINGTYPE); } vProperty.setContent(content); return vProperty; } public static String STRINGTYPE="string"; public static String FLOATTYPE="float"; public static String INTEGERTYPE="integer"; public boolean isString(Property p) { return isType(p, STRINGTYPE); } /** * * @param p the property to test for type * @param typeString one of the string constants in this class * @return true if p is of type 'typeString' */ public boolean isType(Property p, String typeString) { return (p==null) ? false : (p.getType().toLowerCase().equals(typeString)); } }