Last active
August 29, 2015 14:23
-
-
Save Kikimora/733a5b25530629f529e9 to your computer and use it in GitHub Desktop.
This file contains 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 ExternalNews { | |
ObjectReference[] refs; | |
NewsData news; | |
public void addReference(ObjectReference ref) { | |
refs.add(ref); | |
} | |
public Stream<ObjectReference> references() { | |
return StreamSupport.join(movies.stream(), person.stream()); | |
} | |
public void done() { | |
for(ObjectReference r : refs) { | |
if (r.getObject() instanceof MovieData) { | |
news.movieRefs.add(r.getObject()) | |
} else if (r.getObject() instanceof PersonData) { | |
news.personRefs.add(r.getObject()) | |
} | |
} | |
} | |
} | |
public class NewsData { | |
private MovieReference[] movieRefs; | |
private PersonReference[] personRefs; | |
private EntityId[] movieIds, personIds; | |
} | |
public interface ObjectReference<T> { | |
} | |
public class MovieReference implements ObjectReference<Movie> { | |
} | |
public class PersonReference implements ObjectReference<Movie> { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment