/** * Convenience method to protect against a {@code null} argument. */ public static void check(String argumentName, Object argumentValue) { if (argumentValue == null) { throw new NullArgumentException(argumentName); } }
/** * @since 2.3.22 */ public static void check(Object argumentValue) { if (argumentValue == null) { throw new NullArgumentException(); } }
private ClassTemplateLoader(Class<?> resourceLoaderClass, boolean allowNullResourceLoaderClass, ClassLoader classLoader, String basePackagePath) { if (!allowNullResourceLoaderClass) { NullArgumentException.check("resourceLoaderClass", resourceLoaderClass); } NullArgumentException.check("basePackagePath", basePackagePath); // Either set a non-null resourceLoaderClass or a non-null classLoader, not both: this.resourceLoaderClass = classLoader == null ? (resourceLoaderClass == null ? this.getClass() : resourceLoaderClass) : null; if (this.resourceLoaderClass == null && classLoader == null) { throw new NullArgumentException("classLoader"); } this.classLoader = classLoader; String canonBasePackagePath = canonicalizePrefix(basePackagePath); if (this.classLoader != null && canonBasePackagePath.startsWith("/")) { canonBasePackagePath = canonBasePackagePath.substring(1); } this.basePackagePath = canonBasePackagePath; }
throw new NullArgumentException( "outputFormat", "You may meant: " + UndefinedOutputFormat.class.getSimpleName() + ".INSTANCE");
/** * @since 2.3.22 */ public static void check(Object argumentValue) { if (argumentValue == null) { throw new NullArgumentException(); } }
/** * @since 2.3.22 */ public static void check(Object argumentValue) { if (argumentValue == null) { throw new NullArgumentException(); } }
/** * Convenience method to protect against a {@code null} argument. */ public static void check(String argumentName, Object argumentValue) { if (argumentValue == null) { throw new NullArgumentException(argumentName); } }
/** * Convenience method to protect against a {@code null} argument. */ public static void check(String argumentName, Object argumentValue) { if (argumentValue == null) { throw new NullArgumentException(argumentName); } }
public List<TreeNode> collectNodes(NodeCollector collector) { if (collector == null) { throw new NullArgumentException("collector"); } List<TreeNode> nodes = new LinkedList<TreeNode>(); collectNodes(collector, this, nodes); return nodes; }
/** * @param member * @return */ public List<Member> getAncestorMembers(Member member) { if (member == null) { throw new NullArgumentException("member"); } List<Member> ancestors = new ArrayList<Member>(); Member parent = member; while ((parent = getParentMember(parent)) != null) { ancestors.add(parent); } return ancestors; } }
/** * @param cube */ public MemberHierarchyCache(Cube cube) { if (cube == null) { throw new NullArgumentException("cube"); } this.cube = cube; this.util = new OlapUtils(cube); util.setMemberHierarchyCache(this); }
private ClassTemplateLoader(Class<?> resourceLoaderClass, boolean allowNullResourceLoaderClass, ClassLoader classLoader, String basePackagePath) { if (!allowNullResourceLoaderClass) { NullArgumentException.check("resourceLoaderClass", resourceLoaderClass); } NullArgumentException.check("basePackagePath", basePackagePath); // Either set a non-null resourceLoaderClass or a non-null classLoader, not both: this.resourceLoaderClass = classLoader == null ? (resourceLoaderClass == null ? this.getClass() : resourceLoaderClass) : null; if (this.resourceLoaderClass == null && classLoader == null) { throw new NullArgumentException("classLoader"); } this.classLoader = classLoader; String canonBasePackagePath = canonicalizePrefix(basePackagePath); if (this.classLoader != null && canonBasePackagePath.startsWith("/")) { canonBasePackagePath = canonBasePackagePath.substring(1); } this.basePackagePath = canonBasePackagePath; }
private ClassTemplateLoader(Class<?> resourceLoaderClass, boolean allowNullResourceLoaderClass, ClassLoader classLoader, String basePackagePath) { if (!allowNullResourceLoaderClass) { NullArgumentException.check("resourceLoaderClass", resourceLoaderClass); } NullArgumentException.check("basePackagePath", basePackagePath); // Either set a non-null resourceLoaderClass or a non-null classLoader, not both: this.resourceLoaderClass = classLoader == null ? (resourceLoaderClass == null ? this.getClass() : resourceLoaderClass) : null; if (this.resourceLoaderClass == null && classLoader == null) { throw new NullArgumentException("classLoader"); } this.classLoader = classLoader; String canonBasePackagePath = canonicalizePrefix(basePackagePath); if (this.classLoader != null && canonBasePackagePath.startsWith("/")) { canonBasePackagePath = canonBasePackagePath.substring(1); } this.basePackagePath = canonBasePackagePath; }
throw new NullArgumentException( "outputFormat", "You may meant: " + UndefinedOutputFormat.class.getSimpleName() + ".INSTANCE");
throw new NullArgumentException( "outputFormat", "You may meant: " + UndefinedOutputFormat.class.getSimpleName() + ".INSTANCE");
/** * @param member * @return */ public Member getParentMember(Member member) { if (member == null) { throw new NullArgumentException("member"); } if (member.getDepth() == 0) { return null; } logger.trace("Resolving parent member for : {}", member.getUniqueName()); Member parent = get(member.getUniqueName()); if (parent == null) { parent = member.getParentMember(); if (parent == null) { logger.trace("Member doesn't seem to have a parent."); } else { logger.trace( "No cache was found. Storing the parent member : {}", parent.getUniqueName()); parent = util.wrapRaggedIfNecessary(parent); } put(member.getUniqueName(), parent); } else { logger.trace("Returning cached parent member : {}", parent.getUniqueName()); } return parent; }