-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Typed identifiers #227
Comments
It's a nice idea, but I feel like it may be an overkill. Can you list out the benefits and drawbacks? |
As far as I can see right now: Benefits:
Drawbacks:
|
I might have misunderstood what you meant by typed identifiers. So you're saying we should extend a base Identifier class and have subclasses that represent different Identifiers... I think that should be fine :) |
According to the above specification, the base Identifier is supposed to be an interface, but it could also be an abstract class, or it could be an abstract class called |
This reverts commit 5e56559. # Conflicts: # minecraft/1.7/src/main/java/nova/core/wrapper/mc/forge/v17/wrapper/block/BlockConverter.java # minecraft/1.7/src/main/java/nova/core/wrapper/mc/forge/v17/wrapper/item/ItemConverter.java # minecraft/1.8/src/main/java/nova/core/wrapper/mc/forge/v18/wrapper/block/BlockConverter.java # minecraft/1.8/src/main/java/nova/core/wrapper/mc/forge/v18/wrapper/item/ItemConverter.java # src/main/java/nova/core/util/registry/Factory.java
I noticed NOVA always uses string identifiers. IMO NOVA should use typed identifiers:
Identifier
interfaceTheEDIT: I derped, mixed something up .-.I
at the beginning is necessary to avoid conflicts with a bunch of things (e.g. Kotlin). Could also beNOVAIdentifier
- it just can't beIdentifier
.String asString();
equals
,hashCode
andtoString
.UUIDIdentifier
classUUID
.UUID asUUID();
ClassIdentifier
classClass
.Class<?> asClass();
StringIdentifier
classString
.Will make a PR once we figure out if this is a good idea.
The text was updated successfully, but these errors were encountered: