1 package com.netease.nimlib.sdk.v2.setting;
6 private static final int HOURS_IN_DAY = 24;
7 private static final int MINUTES_IN_HOUR = 60;
11 private final boolean showDetail;
16 private final boolean dndOn;
20 private final int fromH;
24 private final int fromM;
28 private final int toH;
32 private final int toM;
35 this(
false,
false, 0, 0, 0, 0);
38 private V2NIMDndConfig(
boolean showDetail,
boolean dndOn,
int fromH,
int fromM,
int toH,
int toM) {
39 this.showDetail = showDetail;
73 return "V2NIMDndConfig{" +
74 "showDetail=" + showDetail +
84 if(fromH < 0 || fromH >= HOURS_IN_DAY){
87 if(fromM < 0 || fromM >= MINUTES_IN_HOUR){
90 if(toH < 0 || toH >= HOURS_IN_DAY){
93 if(toM < 0 || toM >= MINUTES_IN_HOUR){
100 public static final class V2NIMDndConfigBuilder {
101 private boolean showDetail;
102 private boolean dndOn;
103 private final int fromH;
104 private final int fromM;
105 private final int toH;
106 private final int toM;
108 private V2NIMDndConfigBuilder(
int fromH,
int fromM,
int toH,
int toM) {
115 public static V2NIMDndConfigBuilder builder(
int fromH,
int fromM,
int toH,
int toM) {
116 return new V2NIMDndConfigBuilder(fromH, fromM, toH, toM);
119 public V2NIMDndConfigBuilder withShowDetail(
boolean showDetail) {
120 this.showDetail = showDetail;
124 public V2NIMDndConfigBuilder withDndOn(
boolean dndOn) {
130 return new V2NIMDndConfig(showDetail, dndOn, fromH, fromM, toH, toM);