Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Converter {
- private Double value;
- private String from;
- private String to;
- /**
- * @param value
- * @param metric
- */
- public Converter(Double value, String from, String to) {
- this.value = value;
- this.from = from;
- this.to = to;
- }
- /**
- * @return Double
- * @throws Exception must provide data.
- */
- public Double convert() throws Exception {
- switch (this.from) {
- case "in":
- switch (this.to) {
- case "cm":
- return this.value * 2.54;
- }
- default:
- throw new Exception("You didn't provide me with shit fucktard.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement