Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add @Label annotation #5

Closed
programmerr47 opened this issue Apr 5, 2017 · 4 comments
Closed

Add @Label annotation #5

programmerr47 opened this issue Apr 5, 2017 · 4 comments

Comments

@programmerr47
Copy link
Owner

Need to add @Label annotation. Currently, it will be parameterless (but then we will add strategies and e.t.c.) I think we need to implement next rules or similar to them (in order to write less code):

These rules are for parameters without @Label annotation:

  • if there is only one parameter in a method, then it is a label. Thus we need to convert it to String (if it isn't a string already)
  • if there are two parameters and one of them is String, and another is Long or Int, then first will be a label, and last will be a value (I will not implement it now but for the future)
  • if there are two parameters and one of them is String, then it is considered as a label, and other we need to convert to long
  • if there are two parameters and one of them is Long or Int, then it is considered as a value, and other we need to convert to String
  • if there are more than two parameters, then there will be a runtime exception.

Rules for @Label annotation:

  • if there are two values and one of them marked as @Label, then we need to convert somehow other to value
  • if there are more than two parameters, then regardless to annotation we need to throw an exception
@programmerr47
Copy link
Owner Author

programmerr47 commented Apr 7, 2017

Created issue tasks:

  • if there is only one parameter in a method, then it is a label. Thus we need to convert it to String (if it isn't a string already)
  • if there are two parameters and one of them is String, and another is Long or Int, then first will be a label, and last will be a value (I will not implement it now but for the future)
  • if there are two parameters and one of them is String, then it is considered as a label, and other we need to convert to long
  • if there are two parameters and one of them is Long or Int, then it is considered as a value, and other we need to convert to String
  • if there are more than two parameters, then there will be a runtime exception.
  • if there are two values and one of them marked as @Label, then we need to convert somehow other to value
  • if there are more than two parameters, then regardless to annotation we need to throw an exception

@programmerr47
Copy link
Owner Author

Need to
change -> "if there are two parameters and one of them is String, then it is considered as a label, and other we need to convert to long"
to -> "if there are two parameters and one of them is String, and other is not Number, then throw Exception"

programmerr47 pushed a commit that referenced this issue Apr 8, 2017
programmerr47 pushed a commit that referenced this issue Apr 8, 2017
programmerr47 pushed a commit that referenced this issue Apr 10, 2017
@programmerr47
Copy link
Owner Author

Need to add documentation

@programmerr47
Copy link
Owner Author

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant