Make Exported just be SquirrelJMEVendorApi.
[SquirrelJME.git] / modules / cldc-compact / src / main / java / cc / squirreljme / jvm / suite / MatchResult.java
blobadc9a841e3b8f39fc9b314d937c3ac8b958e6769
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.debug.Debugging;
14 /**
15 * This class contains the results of a dependency match.
17 * @since 2017/11/30
19 public final class MatchResult
21 /** The matched results. */
22 protected final DependencyInfo matched;
24 /** The unmatched results. */
25 protected final DependencyInfo unmatched;
27 /**
28 * Initializes the match result.
30 * @param __matched The matched dependencies.
31 * @param __unmatched The unmatched dependencies.
32 * @throws NullPointerException On null arguments.
33 * @since 2017/12/31
35 public MatchResult(DependencyInfo __matched, DependencyInfo __unmatched)
36 throws NullPointerException
38 if (__matched == null || __unmatched == null)
39 throw new NullPointerException("NARG");
41 this.matched = __matched;
42 this.unmatched = __unmatched;
45 /**
46 * {@inheritDoc}
47 * @since 2017/12/31
49 @Override
50 public boolean equals(Object __o)
52 if (this == __o)
53 return true;
55 if (!(__o instanceof MatchResult))
56 return false;
58 MatchResult o = (MatchResult)__o;
59 return this.matched.equals(o.matched) &&
60 this.unmatched.equals(o.unmatched);
63 /**
64 * Returns {@code true} if there have been matches in the result.
66 * @return Has there been any matches?
67 * @since 2017/11/30
69 public final boolean hasMatches()
71 return !this.matched.isEmpty();
74 /**
75 * {@inheritDoc}
76 * @since 2017/12/31
78 @Override
79 public final int hashCode()
81 return this.matched.hashCode() ^
82 this.unmatched.hashCode();
85 /**
86 * Returns the dependency information which contains every dependency
87 * which has been matched.
89 * @return The dependency information containing only matched items.
90 * @since 2017/11/30
92 public final DependencyInfo matched()
94 return this.matched;
97 /**
98 * Returns the dependency information which contains every dependency
99 * which has yet to be matched.
101 * @return The dependency information containing only unmatched items.
102 * @since 2017/11/30
104 public final DependencyInfo unmatched()
106 return this.unmatched;
110 * {@inheritDoc}
111 * @since 2017/12/31
113 @Override
114 public final String toString()
116 throw Debugging.todo();