Skip to content

[RFC] Typed identifiers #227

@SoniEx2

Description

@SoniEx2

I noticed NOVA always uses string identifiers. IMO NOVA should use typed identifiers:

  1. Identifier interface
    • The I at the beginning is necessary to avoid conflicts with a bunch of things (e.g. Kotlin). Could also be NOVAIdentifier - it just can't be Identifier. EDIT: I derped, mixed something up .-.
    • Single method: String asString();
    • Implementations should override equals, hashCode and toString.
  2. UUIDIdentifier class
    • Used when the identifier is an UUID.
    • Additional methods: UUID asUUID();
  3. ClassIdentifier class
    • Used when the identifier is a Class.
    • Additional methods: Class<?> asClass();
  4. StringIdentifier class
    • Used when the identifier is an actual, proper String.

Will make a PR once we figure out if this is a good idea.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions