1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // Multi-Phasic Applications: SquirrelJME
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
.multivm
.ident
;
12 import cc
.squirreljme
.plugin
.multivm
.BangletVariant
;
13 import cc
.squirreljme
.plugin
.multivm
.ClutterLevel
;
14 import cc
.squirreljme
.plugin
.multivm
.VMSpecifier
;
15 import cc
.squirreljme
.plugin
.multivm
.VMType
;
16 import java
.io
.Serializable
;
17 import lombok
.AllArgsConstructor
;
18 import lombok
.Builder
;
19 import lombok
.NonNull
;
23 * Represents the target classifier, the kind of virtual machine and variant
31 public class TargetClassifier
32 implements Serializable
34 /** The virtual machine type. */
38 /** The banglet variant used. */
40 BangletVariant bangletVariant
;
42 /** The clutter level used. */
44 ClutterLevel clutterLevel
;
47 * Sets up a new classifier with the clutter level.
49 * @param __clutterLevel The new clutter level.
50 * @return The classifier with the new clutter level.
51 * @throws NullPointerException On null arguments.
54 public TargetClassifier
withClutterLevel(ClutterLevel __clutterLevel
)
55 throws NullPointerException
57 if (__clutterLevel
== null)
58 throw new NullPointerException("NARG");
60 return new TargetClassifier(this.vmType
, this.bangletVariant
,
65 * Specifies an alternative virtual machine to use, but with the same
68 * @param __vm The virtual machine to use instead.
69 * @return The modified target classifier.
70 * @throws NullPointerException On null arguments.
73 public TargetClassifier
withVm(VMSpecifier __vm
)
74 throws NullPointerException
77 throw new NullPointerException("NARG");
79 return new TargetClassifier(__vm
, this.bangletVariant
,
84 * Returns the classifier to be used by the emulated JIT.
86 * @return The classifier with the appropriate VM based on if it supports
90 public TargetClassifier
withVmByEmulatedJit()
92 if (this.vmType
.hasEmulatorJit())
93 return new TargetClassifier(VMType
.SPRINGCOAT
,
94 BangletVariant
.NONE
, ClutterLevel
.DEBUG
);