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 GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc
.squirreljme
.plugin
.swm
;
13 * This represents the level of the dependency.
17 public enum SuiteDependencyLevel
29 * Is this an optional dependency level?
31 * @return {@code true} if this is an optional dependency level.
34 public boolean isOptional()
36 return this == SuiteDependencyLevel
.OPTIONAL
;
40 * Is this an required dependency level?
42 * @return {@code true} if this is an required dependency level.
45 public boolean isRequired()
47 return this == SuiteDependencyLevel
.REQUIRED
;
55 public String
toString()
60 case REQUIRED
: return "required";
61 case OPTIONAL
: return "optional";
63 throw new RuntimeException(this.toString());
68 * Returns the dependency level based on the input string.
70 * @param __s The input string to parse.
71 * @return The dependency level for the given string.
72 * @throws NullPointerException On null arguments.
75 public static SuiteDependencyLevel
of(String __s
)
76 throws NullPointerException
80 throw new NullPointerException("NARG");
85 case "required": return SuiteDependencyLevel
.REQUIRED
;
86 case "optional": return SuiteDependencyLevel
.OPTIONAL
;
90 throw new RuntimeException(__s
);