-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added new load system NOT TESTED
- Loading branch information
Showing
7 changed files
with
144 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/com/troblecodings/signals/core/LoadHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.troblecodings.signals.core; | ||
|
||
import java.util.Objects; | ||
|
||
public class LoadHolder<T> { | ||
|
||
public final T holder; | ||
|
||
public LoadHolder(final T holder) { | ||
this.holder = holder; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(holder); | ||
} | ||
|
||
@Override | ||
public boolean equals(final Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
final LoadHolder<?> other = (LoadHolder<?>) obj; | ||
return Objects.equals(holder, other.holder); | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/com/troblecodings/signals/core/StateLoadHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.troblecodings.signals.core; | ||
|
||
import java.util.Objects; | ||
|
||
import com.troblecodings.signals.handler.SignalStateInfo; | ||
|
||
public class StateLoadHolder { | ||
|
||
public final SignalStateInfo info; | ||
public final LoadHolder<?> holder; | ||
|
||
public StateLoadHolder(final SignalStateInfo info, final LoadHolder<?> holder) { | ||
this.info = info; | ||
this.holder = holder; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(holder, info); | ||
} | ||
|
||
@Override | ||
public boolean equals(final Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
final StateLoadHolder other = (StateLoadHolder) obj; | ||
return Objects.equals(holder, other.holder) && Objects.equals(info, other.info); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters