Make it so mapping files are used and then reapplied.
[SquirrelJME.git] / modules / cldc-compact / src / main / java / cc / squirreljme / jvm / suite / MatchResult.java
blob8df8a978f390d8b171ad0beb22f2331153ba640a
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.debug.Debugging;
15 /**
16 * This class contains the results of a dependency match.
18 * @since 2017/11/30
20 @Exported
21 public final class MatchResult
23 /** The matched results. */
24 protected final DependencyInfo matched;
26 /** The unmatched results. */
27 protected final DependencyInfo unmatched;
29 /**
30 * Initializes the match result.
32 * @param __matched The matched dependencies.
33 * @param __unmatched The unmatched dependencies.
34 * @throws NullPointerException On null arguments.
35 * @since 2017/12/31
37 @Exported
38 public MatchResult(DependencyInfo __matched, DependencyInfo __unmatched)
39 throws NullPointerException
41 if (__matched == null || __unmatched == null)
42 throw new NullPointerException("NARG");
44 this.matched = __matched;
45 this.unmatched = __unmatched;
48 /**
49 * {@inheritDoc}
50 * @since 2017/12/31
52 @Override
53 public boolean equals(Object __o)
55 if (this == __o)
56 return true;
58 if (!(__o instanceof MatchResult))
59 return false;
61 MatchResult o = (MatchResult)__o;
62 return this.matched.equals(o.matched) &&
63 this.unmatched.equals(o.unmatched);
66 /**
67 * Returns {@code true} if there have been matches in the result.
69 * @return Has there been any matches?
70 * @since 2017/11/30
72 @Exported
73 public final boolean hasMatches()
75 return !this.matched.isEmpty();
78 /**
79 * {@inheritDoc}
80 * @since 2017/12/31
82 @Override
83 public final int hashCode()
85 return this.matched.hashCode() ^
86 this.unmatched.hashCode();
89 /**
90 * Returns the dependency information which contains every dependency
91 * which has been matched.
93 * @return The dependency information containing only matched items.
94 * @since 2017/11/30
96 @Exported
97 public final DependencyInfo matched()
99 return this.matched;
103 * Returns the dependency information which contains every dependency
104 * which has yet to be matched.
106 * @return The dependency information containing only unmatched items.
107 * @since 2017/11/30
109 @Exported
110 public final DependencyInfo unmatched()
112 return this.unmatched;
116 * {@inheritDoc}
117 * @since 2017/12/31
119 @Override
120 public final String toString()
122 throw Debugging.todo();