Created
February 11, 2016 11:38
-
-
Save EmilGeorgiev/878b5f2282f4dc006e3d to your computer and use it in GitHub Desktop.
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
| class Property { | |
| private String name; | |
| private String value; | |
| } | |
| interface Operator { | |
| void changeProperties(List<Property> properties); | |
| } | |
| class MongoOperator implements Operator { | |
| private final Long operatorId; | |
| private final Datastore datastore; | |
| public MongoOperator(Long operatorId, Datastore datastore) { | |
| this.operatorId = operatorId; | |
| this.datastore = datastore; | |
| } | |
| @Override | |
| public void changeProperties(List<Property> properties) { | |
| } | |
| } | |
| interface OperatorRepository { | |
| Operator findOperator(Long operatorId); | |
| } | |
| class PersistentOperatorRepository implements OperatorRepository { | |
| private final Datastore datastore; | |
| public PersistentOperatorRepository(Datastore datastore) { | |
| this.datastore = datastore; | |
| } | |
| @Override | |
| public Operator findOperator(Long operatorId) { | |
| return new MongoOperator(operatorId, datastore); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment