Why not annotate function parameters?
To make this question answerable, let’s assume that the cost of ambiguity in the mind of a programmer is much more expensive then a few extra keystrokes.
How to deliver 3 different parameters to class in one method (2 of 3 are optional)
I need your help how to implement it nice and well. It’s quite a simple problem. I can solve it but I need help on how to do that better.
How to deliver 3 different parameters to class in one method (2 of 3 are optional)
I need your help how to implement it nice and well. It’s quite a simple problem. I can solve it but I need help on how to do that better.
How to encapsulate method parameters in Java?
An HTTP query can be parametrized to a list of pairs like name=value
that can be encapsulated in general as Map<String, String>
since an HTTP GET query is string pairs. I could need something for any combination of objects and primitives. A varargs method for example update(String s1...)
could be written in general as update(Map<String, String>)
where the key is the name and the value is the data.
How to encapsulate method parameters in Java?
An HTTP query can be parametrized to a list of pairs like name=value
that can be encapsulated in general as Map<String, String>
since an HTTP GET query is string pairs. I could need something for any combination of objects and primitives. A varargs method for example update(String s1...)
could be written in general as update(Map<String, String>)
where the key is the name and the value is the data.
How to encapsulate method parameters in Java?
An HTTP query can be parametrized to a list of pairs like name=value
that can be encapsulated in general as Map<String, String>
since an HTTP GET query is string pairs. I could need something for any combination of objects and primitives. A varargs method for example update(String s1...)
could be written in general as update(Map<String, String>)
where the key is the name and the value is the data.
How to encapsulate method parameters in Java?
An HTTP query can be parametrized to a list of pairs like name=value
that can be encapsulated in general as Map<String, String>
since an HTTP GET query is string pairs. I could need something for any combination of objects and primitives. A varargs method for example update(String s1...)
could be written in general as update(Map<String, String>)
where the key is the name and the value is the data.
How to encapsulate method parameters in Java?
An HTTP query can be parametrized to a list of pairs like name=value
that can be encapsulated in general as Map<String, String>
since an HTTP GET query is string pairs. I could need something for any combination of objects and primitives. A varargs method for example update(String s1...)
could be written in general as update(Map<String, String>)
where the key is the name and the value is the data.
How to encapsulate method parameters in Java?
An HTTP query can be parametrized to a list of pairs like name=value
that can be encapsulated in general as Map<String, String>
since an HTTP GET query is string pairs. I could need something for any combination of objects and primitives. A varargs method for example update(String s1...)
could be written in general as update(Map<String, String>)
where the key is the name and the value is the data.
Design Pattern: Algorithm varies according to the input arguments
I will give a simple example to help you understand my question. Suppose we have a rectangle and a Utility class with a method that creates a buffer arround a shape.