@Test public void boxToUserTest() { User user2 = new User("fname", "sName", "eMail@localhost.com", "pw", "en"); user2.save(); assertTrue(mailbox.belongsTo(user.getId())); assertFalse(mailbox.belongsTo(user2.getId())); assertTrue(MBox.boxToUser(mailbox.getId(), user.getId())); assertFalse(MBox.boxToUser(mailbox.getId(), user2.getId())); }
public static boolean boxToUser(long bId, long uId) { MBox mb = Ebean.find(MBox.class, bId); return (mb != null && (mb.getUsr() != null) && (mb.getUsr().getId() == uId)); }
MBox extends AbstractEntity implements Serializable { public static boolean boxToUser(long bId, long uId) { MBox mb = Ebean.find(MBox.class, bId); return (mb != null && (mb.getUsr() != null) && (mb.getUsr().getId() == uId)); } }
MBox extends AbstractEntity implements Serializable { public static boolean boxToUser(long bId, long uId) { MBox mb = Ebean.find(MBox.class, bId); return (mb != null && (mb.getUsr() != null) && (mb.getUsr().getId() == uId)); } MBox();  MBox(String local, String domain, long ts, boolean expired, User usr); }
MBox extends AbstractEntity implements Serializable { public static boolean boxToUser(long bId, long uId) { MBox mb = Ebean.find(MBox.class, bId); return (mb != null && (mb.getUsr() != null) && (mb.getUsr().getId() == uId)); } MBox();  MBox(String local, String domain, long ts, boolean expired, User usr); String getAddress(); void setAddress(String address); @JsonProperty("expired") boolean isExpired(); @JsonIgnore boolean isActive(); @JsonIgnore boolean isExpiredByTimestamp(); @JsonIgnore void setExpired(boolean expired); @JsonIgnore User getUsr(); @JsonIgnore void setUsr(User usr); String getDomain(); void setDomain(String domain); boolean belongsTo(Long uid); @JsonProperty("forwards") int getForwards(); @JsonIgnore void setForwards(int forwards); void increaseForwards(); void resetForwards(); @JsonProperty("suppressions") int getSuppressions(); @JsonIgnore void setSuppressions(int suppressions); void increaseSuppressions(); void resetSuppressions(); @JsonProperty("ts_Active") long getTs_Active(); @JsonIgnore void setTs_Active(long ts_Active); @JsonProperty("datetime") void setDateTime(String dateTime); @JsonIgnore Long getVersion(); @JsonIgnore void setVersion(Long version); @JsonProperty("fullAddress") String getFullAddress(); @JsonIgnore void setFullAddress(String dummy); void increaseFwd(); void increaseSup(); static void delete(Long id); static MBox getById(Long id); static MBox getByName(String mail, String domain); static MBox getByAddress(final String mailAddress); static boolean boxToUser(long bId, long uId); static String getFwdByName(String mail, String domain); static List<MBox> all(); static List<MBox> allUser(Long id); static boolean mailExists(String mail, String domain); @JsonIgnore String getTSAsStringWithNull(); String getDatetime(); void resetIdAndCounterFields(); static List<MBox> getNextBoxes(int minutes); void enable(); void disable(); static List<MBox> findBoxLike(String input, long userId); static MBox find(String localPart, String domain); static String getMailsForTxt(long userId); static String getActiveMailsForTxt(Long userId); static String getSelectedMailsForTxt(Long userId, List<Long> boxIds); static int removeListOfBoxes(long userId, List<Long> boxIds); static int resetListOfBoxes(long userId, List<Long> boxIds); static int disableListOfBoxes(long userId, List<Long> boxIds); static int enableListOfBoxesIfPossible(long userId, List<Long> boxIds); static int setNewDateForListOfBoxes(long userId, List<Long> boxIds, long ts_Active); String toString(); boolean isForwardEmails(); void setForwardEmails(boolean forwardEmails); }
MBox extends AbstractEntity implements Serializable { public static boolean boxToUser(long bId, long uId) { MBox mb = Ebean.find(MBox.class, bId); return (mb != null && (mb.getUsr() != null) && (mb.getUsr().getId() == uId)); } MBox();  MBox(String local, String domain, long ts, boolean expired, User usr); String getAddress(); void setAddress(String address); @JsonProperty("expired") boolean isExpired(); @JsonIgnore boolean isActive(); @JsonIgnore boolean isExpiredByTimestamp(); @JsonIgnore void setExpired(boolean expired); @JsonIgnore User getUsr(); @JsonIgnore void setUsr(User usr); String getDomain(); void setDomain(String domain); boolean belongsTo(Long uid); @JsonProperty("forwards") int getForwards(); @JsonIgnore void setForwards(int forwards); void increaseForwards(); void resetForwards(); @JsonProperty("suppressions") int getSuppressions(); @JsonIgnore void setSuppressions(int suppressions); void increaseSuppressions(); void resetSuppressions(); @JsonProperty("ts_Active") long getTs_Active(); @JsonIgnore void setTs_Active(long ts_Active); @JsonProperty("datetime") void setDateTime(String dateTime); @JsonIgnore Long getVersion(); @JsonIgnore void setVersion(Long version); @JsonProperty("fullAddress") String getFullAddress(); @JsonIgnore void setFullAddress(String dummy); void increaseFwd(); void increaseSup(); static void delete(Long id); static MBox getById(Long id); static MBox getByName(String mail, String domain); static MBox getByAddress(final String mailAddress); static boolean boxToUser(long bId, long uId); static String getFwdByName(String mail, String domain); static List<MBox> all(); static List<MBox> allUser(Long id); static boolean mailExists(String mail, String domain); @JsonIgnore String getTSAsStringWithNull(); String getDatetime(); void resetIdAndCounterFields(); static List<MBox> getNextBoxes(int minutes); void enable(); void disable(); static List<MBox> findBoxLike(String input, long userId); static MBox find(String localPart, String domain); static String getMailsForTxt(long userId); static String getActiveMailsForTxt(Long userId); static String getSelectedMailsForTxt(Long userId, List<Long> boxIds); static int removeListOfBoxes(long userId, List<Long> boxIds); static int resetListOfBoxes(long userId, List<Long> boxIds); static int disableListOfBoxes(long userId, List<Long> boxIds); static int enableListOfBoxesIfPossible(long userId, List<Long> boxIds); static int setNewDateForListOfBoxes(long userId, List<Long> boxIds, long ts_Active); String toString(); boolean isForwardEmails(); void setForwardEmails(boolean forwardEmails);  }