本文整理匯總了Java中org.springframework.data.annotation.Transient類的典型用法代碼示例。如果您正苦於以下問題:Java Transient類的具體用法?Java Transient怎麽用?Java Transient使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Transient類屬於org.springframework.data.annotation包,在下文中一共展示了Transient類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: apply
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
@Transient
@Override
public RestTransformationStepVO apply(TransformationStep t) {
RestTransformationStepVO r = new RestTransformationStepVO();
r.setType(IntegrationType.REST);
r.setMethod((String) t.getAttributes()
.get(RestTransformationStep.REST_ATTRIBUTE_METHOD));
r.setUsername((String) t.getAttributes()
.get(RestTransformationStep.REST_USERNAME_ATTRIBUTE_NAME));
r.setPassword((String) t.getAttributes()
.get(RestTransformationStep.REST_PASSWORD_ATTRIBUTE_NAME));
r.setUrl((String) t.getAttributes()
.get(RestTransformationStep.REST_URL_ATTRIBUTE_NAME));
r.setHeaders((Map) t.getAttributes()
.get(RestTransformationStep.REST_ATTRIBUTE_HEADERS));
return r;
}
示例2: transform
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
/**
* Get granted authorities as collection of
* SimpleGrantedAuthorities(roleName) for each role:
*
* TODO should be used by permission manager
*
* @return JAVADOC.
*/
@SuppressWarnings("unchecked")
@Transient
public Collection<?extends GrantedAuthority> getAuthorities() {
Collection<Permission> permissions = getPermissions();
if (permissions == null) {
return DEFAULT_AUTHORITIES;
}
return CollectionUtils.collect(permissions,
new Transformer() {
@Override
public Object transform(Object arg0) {
Permission permission = (Permission) arg0;
BeanWrapper beanWrapper = new BeanWrapperImpl(permission.getRole());
String name = (String) beanWrapper.getPropertyValue("name");
return new SimpleGrantedAuthority(name);
}
});
}
示例3: hasAssignedBot
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
@Transient
public boolean hasAssignedBot(){
return participants.stream()
.filter(Participant::isBot)
.findFirst()
.isPresent();
}
示例4: hasAssignedAgent
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
@Transient
public boolean hasAssignedAgent(){
return participants.stream()
.filter(Participant::isAgent)
.findFirst()
.isPresent();
}
示例5: getUserName
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
@Transient
public String getUserName(){
return this.participants.stream()
.filter(Participant::isUser)
.map(Participant::getName)
.findFirst()
.orElse("NOT ASSIGNED");
}
示例6: getAgentName
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
@Transient
public String getAgentName(){
return this.participants.stream()
.filter(Participant::isAgent)
.map(Participant::getName)
.findFirst()
.orElse("NOT ASSIGNED");
}
示例7: setUserPhoneNumber
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
@Transient
public void setUserPhoneNumber(String phoneNumber){
this.phoneNumber = phoneNumber;
Optional<Participant> user = findParticipantByType(ParticipantType.USER);
if(user.isPresent()){
user.get().setPhoneNumber(phoneNumber);
}
}
示例8: isAnonymous
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
@Transient
public boolean isAnonymous(){
return this.participants.stream()
.filter(Participant::isUser)
.filter( p -> Participant.ANNONYMUS_USER.equals(p.getName()) )
.findFirst()
.isPresent();
}
示例9: assignBot
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
@Transient
public Participant assignBot(){
if(hasAssignedBot()){
return getBot().get();
}
Participant bot = new Participant();
bot.setType(ParticipantType.BOT);
bot.setName("Bot");
bot.setId(UUID.randomUUID().toString());
participants.add(bot);
return bot;
}
示例10: toParticipant
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
@Transient
public Participant toParticipant(){
Participant participant = new Participant();
participant.setId(this.getId());
participant.setName(this.getFullName());
participant.setType(ParticipantType.AGENT);
participant.setPhoneNumber(this.getPhone());
return participant;
}
示例11: isUserMessage
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
@Transient
public boolean isUserMessage(){
Participant participant = getParticipant();
if(participant != null && participant.isUser()){
return true;
}
return false;
}
示例12: isBotMessage
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
@Transient
public boolean isBotMessage(){
Participant participant = getParticipant();
if(participant != null && participant.isBot()){
return true;
}
return false;
}
示例13: isAgentMessage
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
@Transient
public boolean isAgentMessage(){
Participant participant = getParticipant();
if(participant != null && participant.isAgent()){
return true;
}
return false;
}
示例14: getParticipantName
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
@Transient
public String getParticipantName(){
if(conversation != null)
return conversation.findParticipantById(participantId).get().getName();
return "";
}
示例15: getParticipant
import org.springframework.data.annotation.Transient; //導入依賴的package包/類
@Transient
public Participant getParticipant(){
if(conversation != null)
return conversation.getParticipants().stream()
.filter( p -> p.getId().equals(participantId))
.findFirst()
.orElse( null );
return null;
}