Code example for Cache

Methods: asMapgetIfPresentput

0
    this.relativeId = FullName.ASSEMBLE_PATH_PARTS.apply( new String[] { "user", user.getName( ) } );
    this.qName = this.authority + this.relativeId;
  } 
   
  public static UserFullName getInstance( final String userId, final String... relativePath ) {
    if ( userIdMap.asMap().containsKey( userId ) ) {
      return userIdMap.getIfPresent( userId );
    } else { 
      try { 
        userIdMap.put( userId, getInstance( Accounts.lookupUserById( userId ), relativePath ) );
        return userIdMap.getIfPresent( userId );
      } catch ( final AuthException ex ) {
        userIdMap.put( userId, getInstance( Principals.systemUser( ), relativePath ) );
        return userIdMap.getIfPresent( userId );
      } 
    } 
  } 
   
  public static UserFullName getInstance( final User user, final String... relativePath ) {
    try { 
Contextual code suggestions in your IDE  Get Codota for Java