Gets the principal from the given name. The principal
is created by the factory instance.

@param name   the name
@param isNtlm the is ntlm
@return the simple principal
195173
protected Principal getPrincipal(final String name, final boolean isNtlm) {
        if (this.principalWithDomainName) {
            return this.principalFactory.createPrincipal(name);
        }
        if (isNtlm) {
            if (Pattern.matches("\\S+\\\\\\S+", name)) {
                val splitList = Splitter.on(Pattern.compile("\\\\")).splitToList(name);
                if (splitList.size() == 2) {
                    return this.principalFactory.createPrincipal(splitList.get(1));
                }
            }
            return this.principalFactory.createPrincipal(name);
        }
        val splitList = Splitter.on("@").splitToList(name);
        return this.principalFactory.createPrincipal(splitList.get(0));
    }
75673
public String toLocal(Principal principal) {
        // This technically does not conform with rfc1964, but should work so
        // long as you don't have any really odd names in your KDC.
        return principal == null ? null : principal.getName().split("[/@]")[0];
    }
996626
private final CClassLoader getLoaderByName(final String name) {
		try {

			CClassLoader loader = (CClassLoader) this.childrenMap.get(name);

			if (loader == null) {
				loader = CClassLoader.createLoader(this, name);
				this.childrenMap.put(name, loader);
			}

			return loader;
		} finally {
			try {

			} catch (final Exception ignore) {
			}
		}
	}
331484
protected String extractFirstName(String name) {
    if (StringUtils.isBlank(name)) {
      return null;
    }
    
    int lastIndexOf = name.lastIndexOf(' ');
    
    if (lastIndexOf == -1)
      return null;
    else
      return name.substring(0, lastIndexOf);
  }
697788
public String getValue(String name) {
		String result = null;
		for (InitParam initParam : initParams) {
			if (initParam.getName().equals(name)) {
				result = initParam.getValue();
				break;
			}
		}
		return result;
	}
865304
public Principal getIssuerDN() {
        if (info == null)
            return null;
        try {
            Principal issuer = (Principal)info.get(X509CertInfo.ISSUER + DOT +
                                                   X509CertInfo.DN_NAME);
            return issuer;
        } catch (Exception e) {
            return null;
        }
    }
644441
public static String getFirstLowerName(String name) {
        if (StringUtils.isBlank(name)) {
            return null;
        }
        String firstChar = name.substring(0, 1).toLowerCase();
        return firstChar + name.substring(1);
    }
1134130
public @Nullable <T> T get(@NotNull String name, @NotNull Class<T> type) {
    return getForComponent(component, name, type);
  }
894832
@Nullable
  public DirectoryEntry getRoot(Name name) {
    Directory dir = roots.get(name);
    return dir == null ? null : dir.entryInParent();
  }
1038997
public static function getAnonymous(): Principal
    {
        if (self::$anon === null) {
            self::$anon = new self(null, [], true);
        }
        return self::$anon;
    }
536582
public boolean isNull(String name) {
        JsonElement value = nameValuePairs.get(name);
        return value.isNull();
    }
740557
public static String getPropertyOrNull(String name) {
        try {
            return AccessController.doPrivileged(new SystemPropertyAction(name));
        } catch (SecurityException ex) {
            LOG.log(Level.FINE, "SecurityException raised getting property " + name, ex);
            return null;
        }
    }
725191
public String getPrincipal() {
        String principal = target.getPrincipal();
        if (StringUtils.hasText(principal)) {
            return principal;
        } else {
            return defaultUser;
        }
    }
1373402
public Object getValue(@NonNull String name) {
        if (name == null) { throw new IllegalArgumentException("name cannot be null."); }
        return map.get(name);
    }
247606
public Class<?> forName(final String name) throws ClassNotFoundException {
        if (System.getSecurityManager() == null)
            return Class.forName(name);
        try {
            return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
                @Override
                public Class<?> run() throws Exception {
                    return Class.forName(name);
                }
            }, controlContext);
        } catch (PrivilegedActionException e) {
            if (e.getException() instanceof ClassNotFoundException)
                throw (ClassNotFoundException) e.getException();
            throw (RuntimeException) e.getException();
        }
    }
57150
Level getLevelProperty(String name, Level defaultValue) {
        String val = getProperty(name);
        if (val == null) {
            return defaultValue;
        }
        Level l = Level.findLevel(val.trim());
        return l != null ? l : defaultValue;
    }
631353
@MemberOrder(sequence = "2")
    public NonTenantedEntity create(
            @Parameter(maxLength = NonTenantedEntity.MAX_LENGTH_NAME)
            @ParameterLayout(named="Name")
            final String name) {
        final NonTenantedEntity obj = container.newTransientInstance(NonTenantedEntity.class);
        obj.setName(name);
        container.persistIfNotAlready(obj);
        return obj;
    }