Created
May 11, 2023 04:07
-
-
Save Frederick888/9f64eb889a5150c2456eee18954b7ca2 to your computer and use it in GitHub Desktop.
Functional
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Functional { | |
void consume(String value); | |
String supply(); | |
String operate(String value); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StringFunctional implements Functional { | |
@Override | |
public void consume(String value) { | |
System.out.println(value); | |
} | |
@Override | |
public String supply() { | |
return "supply some string"; | |
} | |
@Override | |
public String operate(String value) { | |
return value.toUpperCase(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment