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
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" | |
) |
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
// @leonidasgtzr | |
interface TV { | |
void show(); | |
} | |
class ColorTV implements TV { | |
@Override | |
public void show() { | |
System.out.println("Showing content with Color ... "); | |
} |
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
interface TV { | |
void show(); | |
} | |
enum TVFactory { | |
COLOR { | |
@Override | |
TV create() { | |
return () -> { | |
System.out.println("Showing content in Color ... "); |
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
enum ShapeType { | |
CIRCLE { | |
@Override | |
public Supplier<Shape> create() { | |
return Circle::new; | |
} | |
}, | |
RECTANGLE { | |
@Override | |
public Supplier<Shape> create() { |