Make it so mapping files are used and then reapplied.
[SquirrelJME.git] / modules / cldc-compact / src / main / java / cc / squirreljme / jvm / suite / SuiteVendor.java
blob2cbfc7bad9277487a52bc9d4ef660ce4f10de6a2
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // 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.jvm.suite;
12 import cc.squirreljme.runtime.cldc.annotation.Exported;
13 import cc.squirreljme.runtime.cldc.util.StringUtils;
15 /**
16 * This represents the vendor of a midlet suite.
18 * @since 2016/10/12
20 @Exported
21 public final class SuiteVendor
22 implements Comparable<SuiteVendor>
24 /** String value. */
25 protected final String string;
27 /**
28 * Initializes the suite vendor.
30 * @param __v The value to parse.
31 * @throws InvalidSuiteException If the input is not valid.
32 * @throws NullPointerException On null arguments.
33 * @since 2016/10/12
35 @Exported
36 public SuiteVendor(String __v)
37 throws InvalidSuiteException, NullPointerException
39 // Check
40 if (__v == null)
41 throw new NullPointerException("NARG");
43 // {@squirreljme.error DG0h An illegal character was
44 // specified in the midlet suite vendor. (The midlet suite
45 // vendor)}
46 if (StringUtils.firstIndex("\0\r\n:;", __v) >= 0)
47 throw new InvalidSuiteException(String.format("AD0d %s", __v));
49 this.string = __v;
52 /**
53 * {@inheritDoc}
54 * @since 2016/10/12
56 @Override
57 public int compareTo(SuiteVendor __o)
59 return this.string.compareTo(__o.string);
62 /**
63 * {@inheritDoc}
64 * @since 2016/10/12
66 @Override
67 public boolean equals(Object __o)
69 // Check
70 if (!(__o instanceof SuiteVendor))
71 return false;
73 return this.string.equals(((SuiteVendor)__o).string);
76 /**
77 * {@inheritDoc}
78 * @since 2016/10/12
80 @Override
81 public int hashCode()
83 return this.string.hashCode();
86 /**
87 * {@inheritDoc}
88 * @since 2016/10/12
90 @Override
91 public String toString()
93 return this.string;