8000 @NotNull and Optional parsed argument values · Issue #440 · CommandAPI/CommandAPI · GitHub
[go: up one dir, main page]

Skip to content
@NotNull and Optional parsed argument values #440
Closed
@CubBossa

Description

@CubBossa

Description

Could we maybe have get(int) in our arguments with @NotNull and as replacement Optional getOptional(int)? In most cases the argument can't be null and if its supposed to potentially be, one could use the optional getter. An exception could be thrown in the get method if the object is expected to be notnull but is null

Expected code

Before:

@Nullable Object get(int index);

After:

@NotNull Object get(int index);
Optional<Object> getOptional(int index);

Extra details

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestimplemented for next releaseThis has been implemented in the current dev build for the next public release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0