Advertisement
jbjares

randomSouce

May 10th, 2015
498
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1.     private Source getSource() {
  2.         Source source = new Source();
  3.         source.setAutoPlay(new Random().nextBoolean());
  4.         source.setBackgrounded(new Random().nextBoolean());
  5.         int sourceNameInt = new Random().nextInt(SourceNamesEnum.values().length);
  6.         source.setPlatform(ANDROID_X_X+sourceNameInt);
  7.         source.setName(SourceNamesEnum.get(sourceNameInt).name());
  8.         source.setDevice(XYZ_V+sourceNameInt);
  9.         return source;
  10.     }
  11.  
  12. PS.: SourceNamesEnum can be found at http://pastebin.com/VJkMqay3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement