use of java.beans.Transient in project MantaroBot by Mantaro.
the class PlayerData method anniversary.
@Transient
public String anniversary() {
if (getMarriedSince() == null)
return null;
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault());
Calendar cal = new GregorianCalendar();
cal.setTime(new Date(getMarriedSince()));
cal.add(Calendar.YEAR, 1);
return sdf.format(cal.getTime());
}
use of java.beans.Transient in project MantaroBot by Mantaro.
the class PlayerData method anniversary.
@Transient
public String anniversary() {
if (getMarriedSince() == null || getMarriedSince() == 0)
return null;
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault());
Calendar cal = new GregorianCalendar();
cal.setTime(new Date(getMarriedSince()));
cal.add(Calendar.YEAR, 1);
return sdf.format(cal.getTime());
}
use of java.beans.Transient in project Workload by amoxu.
the class UserServiceImpl method updateUser.
@Transient
@Override
public void updateUser(User user) throws CustomException {
user.setPassword(userMapper.selectByPrimaryKey(user.getId()).getPassword());
user.setAnswer(userMapper.selectByPrimaryKey(user.getId()).getAnswer());
Subject subject = SecurityUtils.getSubject();
int ret;
if (10000 == user.getId()) {
if (subject.hasRole("超级管理员")) {
ret = userMapper.updateByPrimaryKey(user);
} else {
throw new CustomException("权限不足");
}
} else {
ret = userMapper.updateByPrimaryKey(user);
}
if (ret == 1) {
return;
} else {
throw new CustomException("更新失败,请联系管理员。");
}
}
use of java.beans.Transient in project api-core by ca-cwds.
the class BaseAttorney method getPhones.
// =======================
// ApiMultiplePhonesAware:
// =======================
@JsonIgnore
@Override
@Transient
public ApiPhoneAware[] getPhones() {
List<ApiPhoneAware> phones = new ArrayList<>();
if (this.primaryPhoneNumber != null && this.messagePhoneNumber != 0) {
phones.add(new ReadablePhone(null, String.valueOf(this.primaryPhoneNumber), this.primaryPhoneExtensionNumber != null ? this.primaryPhoneExtensionNumber.toString() : null, null));
}
if (this.messagePhoneNumber != null && this.messagePhoneNumber != 0) {
LOGGER.debug("add message phone");
phones.add(new ReadablePhone(null, String.valueOf(this.messagePhoneNumber), this.messagePhoneExtensionNumber != null ? this.messagePhoneExtensionNumber.toString() : null, ApiPhoneAware.PhoneType.Cell));
}
return phones.toArray(new ApiPhoneAware[0]);
}
use of java.beans.Transient in project MantaroBot by Mantaro.
the class PlayerData method marryDate.
@Transient
public String marryDate() {
if (getMarriedSince() == null || getMarriedSince() == 0)
return null;
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault());
final Date date = new Date(getMarriedSince());
return sdf.format(date);
}
Aggregations