Refine search
private boolean getBooleanValueFor(String propertyName, boolean defaultValue) { boolean value = defaultValue; PropertyState property = definition.getProperty(propertyName); if (property != null) { value = property.getValue(Type.BOOLEAN); } return value; }
private String getStringValueFor(String propertyName, String defaultValue) { String value = defaultValue; PropertyState property = nodeState.getProperty(propertyName); if (property != null) { value = property.getValue(Type.STRING); } return value; }
private int getIntValueFor(String propertyName, int defaultValue) { long value = defaultValue; PropertyState property = nodeState.getProperty(propertyName); if (property != null) { value = property.getValue(Type.LONG); } return (int) value; }
private boolean getBooleanValueFor(String propertyName, boolean defaultValue) { boolean value = defaultValue; PropertyState property = definition.getProperty(propertyName); if (property != null) { value = property.getValue(Type.BOOLEAN); } return value; }
public static boolean isIndexNodeType(NodeState state) { PropertyState ps = state.getProperty(JCR_PRIMARYTYPE); return ps != null && ps.getValue(STRING).equals(INDEX_DEFINITIONS_NODE_TYPE); }
private static String[] getOptionalStrings(NodeState defn, String propertyName) { PropertyState ps = defn.getProperty(propertyName); if (ps != null) { return Iterables.toArray(ps.getValue(Type.STRINGS), String.class); } return null; }
private static String[] getOptionalStrings(NodeState defn, String propertyName) { PropertyState ps = defn.getProperty(propertyName); if (ps != null) { return Iterables.toArray(ps.getValue(Type.STRINGS), String.class); } return null; }
@Nullable public static String getPrimaryTypeName(NodeState nodeState) { PropertyState ps = nodeState.getProperty(JcrConstants.JCR_PRIMARYTYPE); return (ps == null) ? null : ps.getValue(Type.NAME); }
@Override protected boolean match(NodeState state, Filter filter) { if (uuid == null) { return false; } PropertyState propertyState = state.getProperty("jcr:uuid"); return propertyState != null && uuid.equals(propertyState.getValue(Type.STRING)); }
public static boolean isIndexNodeType(NodeState state) { PropertyState ps = state.getProperty(JCR_PRIMARYTYPE); return ps != null && ps.getValue(STRING).equals(INDEX_DEFINITIONS_NODE_TYPE); }
@CheckForNull public static String getPrimaryTypeName(NodeState nodeState) { PropertyState ps = nodeState.getProperty(JcrConstants.JCR_PRIMARYTYPE); return (ps == null) ? null : ps.getValue(Type.NAME); }
private static String getDate(NodeState checkpoint, String name) { PropertyState p = checkpoint.getProperty(name); if (p == null) { return "NA"; } return new Date(p.getValue(Type.LONG)).toString(); }
@NotNull static String uuidFromNode(@NotNull NodeState node) { PropertyState p = checkNotNull(node).getProperty(JCR_UUID); if (p == null) { throw new IllegalArgumentException("Not referenceable"); } return p.getValue(Type.STRING); }
@Nonnull static String uuidFromNode(@Nonnull NodeState node) { PropertyState p = checkNotNull(node).getProperty(JCR_UUID); if (p == null) { throw new IllegalArgumentException("Not referenceable"); } return p.getValue(Type.STRING); }
private Iterable<String> getStringValuesFor(String propertyName) { Iterable<String> values = null; PropertyState property = definition.getProperty(propertyName); if (property != null && property.isArray()) { values = property.getValue(Type.STRINGS); } return values; }
@Override public IndexEntry produce(NodeState indexHit, String pathName) { PropertyState s = indexHit.getProperty("entry"); return new IndexEntry(s.getValue(Type.STRING, 0), pathName); } });
private static <T> T getProperty(NodeState state, String name, Type<T> type) { if (state.hasProperty(name)) { return state.getProperty(name).getValue(type); } return null; }
public static boolean getBoolean(NodeState state, String name) { PropertyState property = state.getProperty(name); return property != null && property.getType() == BOOLEAN && property.getValue(BOOLEAN); }
public static Iterable<String> getNames(NodeState state, String name) { PropertyState property = state.getProperty(name); if (property != null && property.getType() == NAMES) { return property.getValue(NAMES); } else { return emptyList(); } }
private static String getPrimaryType(NodeState before) { PropertyState primaryType = before.getProperty(JCR_PRIMARYTYPE); if (primaryType != null && primaryType.getType() == NAME) { return primaryType.getValue(NAME); } else { return null; } }