@SuppressWarnings("unchecked") public static Map<String, String> asMap( Properties properties ) { return cast( properties ); }
public static boolean isBasicType( Class<?> clazz ) { if ( clazz == null ) { return false; } return ( String.class.isAssignableFrom( clazz ) ) || isPrimitiveType( clazz ); } }
public static boolean isPrimitiveType( Class<?> clazz ) { if ( clazz == null ) { return false; } return clazz.isPrimitive() || isWrapperType( clazz ); }
else if ( !isBasicType( node.getClass() ) && ( !( node instanceof JsonNode ) ) ) { buildKeyValueSet( toJsonNode( node ), keyValues, path, fulltextIndex, history ); List<Object> keywords = cast( keywords( ( String ) node ) );
if ( isBasicType( obj.getClass() ) ) { return obj;
boolean coTypeIsBasic = ClassUtils.isBasicType( dictionaryCoType );
@SuppressWarnings("unchecked") public Message( Map<String, Object> properties ) { this.properties.putAll( coerceMap( ( Map<String, Class<?>> ) cast( MESSAGE_PROPERTIES ), properties ) ); }
boolean coTypeIsBasic = ClassUtils.isBasicType(dictionaryCoType);
@SuppressWarnings("unchecked") public static Map<String, List<?>> toMapList( Map<String, ?> m ) { Map<String, List<Object>> mapList = new LinkedHashMap<String, List<Object>>(); for ( Entry<String, ?> e : m.entrySet() ) { if ( e.getValue() instanceof List ) { addListToMapList( mapList, e.getKey(), ( List<Object> ) e.getValue() ); } else { addMapList( mapList, e.getKey(), e.getValue() ); } } return cast( mapList ); }
boolean coTypeIsBasic = ClassUtils.isBasicType( setCoType );
@Override public Set<String> getCounterNames() throws Exception { Set<String> names = new TreeSet<String>( CASE_INSENSITIVE_ORDER ); Set<String> nameSet = cast( getDictionaryAsSet( getApplicationRef(), Schema.DICTIONARY_COUNTERS ) ); names.addAll( nameSet ); return names; }
@Override public Map<String, String> getUserGroupRoles( UUID userId, UUID groupId ) throws Exception { // TODO this never returns anything - write path not invoked EntityRef userRef = userRef( userId ); return cast( getDictionaryAsMap( userRef, DICTIONARY_ROLENAMES ) ); }
@Override public Set<String> getUserPermissions( UUID userId ) throws Exception { return cast(getDictionaryAsSet( new SimpleEntityRef( User.ENTITY_TYPE, userId ), Schema.DICTIONARY_PERMISSIONS ) ); }
@Override public Set<String> getUserRoles( UUID userId ) throws Exception { return cast( getDictionaryAsSet( userRef( userId ), DICTIONARY_ROLENAMES ) ); }
@Override public Map<String, String> getRoles() throws Exception { return cast(getDictionaryAsMap(getApplicationRef(), DICTIONARY_ROLENAMES)); }
@Override public Map<String, String> getGroupRoles( UUID groupId ) throws Exception { return cast( getDictionaryAsMap( new SimpleEntityRef( Group.ENTITY_TYPE, groupId ), DICTIONARY_ROLENAMES ) ); }
@Override public Set<String> getGroupPermissions( UUID groupId ) throws Exception { return cast( getDictionaryAsSet( groupRef( groupId ), Schema.DICTIONARY_PERMISSIONS ) ); }
@JsonSerialize(include = Inclusion.NON_NULL) public Map<UUID, EntityRef> getRefsMap() { if ( refsMap != null ) { return refsMap; } getEntitiesMap(); if ( entitiesMap != null ) { refsMap = cast( entitiesMap ); return refsMap; } getRefs(); if ( refs != null ) { refsMap = new LinkedHashMap<UUID, EntityRef>(); for ( EntityRef ref : refs ) { refsMap.put( ref.getUuid(), ref ); } } return refsMap; }
public List<EntityRef> getEntityRefsByType( String type ) { if ( entitiesByType != null ) { return refsByType.get( type ); } List<EntityRef> l = cast( getEntitiesByType( type ) ); if ( l != null ) { return l; } getRefs(); if ( refs == null ) { return null; } refsByType = new LinkedHashMap<String, List<EntityRef>>(); for ( Entity entity : entities ) { l = refsByType.get( entity.getType() ); if ( l == null ) { l = new ArrayList<EntityRef>(); refsByType.put( entity.getType(), l ); } l.add( entity ); } return l; }
public static CounterQuery fromJsonString( String json ) { Object o = JsonUtils.parse( json ); if ( o instanceof Map ) { @SuppressWarnings({ "unchecked", "rawtypes" }) Map<String, List<String>> params = cast( toMapList( ( Map ) o ) ); return fromQueryParams( params ); } return null; }