1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc
.squirreljme
.jvm
.suite
;
12 import cc
.squirreljme
.runtime
.cldc
.debug
.Debugging
;
15 * This represents the level of the dependency.
19 public enum SuiteDependencyLevel
31 * Is this an optional dependency level?
33 * @return {@code true} if this is an optional dependency level.
36 public boolean isOptional()
38 return this == SuiteDependencyLevel
.OPTIONAL
;
42 * Is this an required dependency level?
44 * @return {@code true} if this is an required dependency level.
47 public boolean isRequired()
49 return this == SuiteDependencyLevel
.REQUIRED
;
57 public String
toString()
62 case REQUIRED
: return "required";
63 case OPTIONAL
: return "optional";
65 throw Debugging
.oops();
70 * Returns the dependency level based on the input string.
72 * @param __s The input string to parse.
73 * @return The dependency level for the given string.
74 * @throws IllegalArgumentException If the level is not valid.
75 * @throws NullPointerException On null arguments.
78 public static SuiteDependencyLevel
of(String __s
)
79 throws IllegalArgumentException
, NullPointerException
83 throw new NullPointerException("NARG");
88 case "required": return SuiteDependencyLevel
.REQUIRED
;
89 case "optional": return SuiteDependencyLevel
.OPTIONAL
;
91 /* {@squirreljme.error DG82 Invalid dependency level. (Level)} */
93 throw new IllegalArgumentException(String
.format(