本文整理了Java中com.amazonaws.services.simpledb.model.Attribute.getName()
方法的一些代码示例,展示了Attribute.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attribute.getName()
方法的具体详情如下:
包路径:com.amazonaws.services.simpledb.model.Attribute
类名称:Attribute
方法名:getName
[英]The name of the attribute.
[中]属性的名称。
代码示例来源:origin: aws/aws-sdk-java
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getAlternateNameEncoding() == null) ? 0 : getAlternateNameEncoding().hashCode());
hashCode = prime * hashCode + ((getValue() == null) ? 0 : getValue().hashCode());
hashCode = prime * hashCode + ((getAlternateValueEncoding() == null) ? 0 : getAlternateValueEncoding().hashCode());
return hashCode;
}
代码示例来源:origin: Netflix/Priam
private void addProperty(Item item) {
Iterator<Attribute> attrs = item.getAttributes().iterator();
String prop = "";
String value = "";
String dc = "";
while (attrs.hasNext()) {
Attribute att = attrs.next();
if (att.getName().equals(Attributes.PROPERTY)) prop = att.getValue();
else if (att.getName().equals(Attributes.PROPERTY_VALUE)) value = att.getValue();
else if (att.getName().equals(Attributes.REGION)) dc = att.getValue();
}
// Ignore, if not this region
if (StringUtils.isNotBlank(dc) && !dc.equals(getRegion())) return;
// Override only if region is specified
if (data.containsKey(prop) && StringUtils.isBlank(dc)) return;
data.put(prop, value);
}
代码示例来源:origin: aws/aws-sdk-java
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getAlternateNameEncoding() != null)
sb.append("AlternateNameEncoding: ").append(getAlternateNameEncoding()).append(",");
if (getValue() != null)
sb.append("Value: ").append(getValue()).append(",");
if (getAlternateValueEncoding() != null)
sb.append("AlternateValueEncoding: ").append(getAlternateValueEncoding());
sb.append("}");
return sb.toString();
}
代码示例来源:origin: Netflix/Priam
/**
* Convert a simpledb item to PriamInstance
*
* @param item
* @return
*/
public PriamInstance transform(Item item) {
PriamInstance ins = new PriamInstance();
for (Attribute att : item.getAttributes()) {
if (att.getName().equals(Attributes.INSTANCE_ID)) ins.setInstanceId(att.getValue());
else if (att.getName().equals(Attributes.TOKEN)) ins.setToken(att.getValue());
else if (att.getName().equals(Attributes.APP_ID)) ins.setApp(att.getValue());
else if (att.getName().equals(Attributes.ID))
ins.setId(Integer.parseInt(att.getValue()));
else if (att.getName().equals(Attributes.AVAILABILITY_ZONE)) ins.setRac(att.getValue());
else if (att.getName().equals(Attributes.ELASTIC_IP)) ins.setHostIP(att.getValue());
else if (att.getName().equals(Attributes.HOSTNAME)) ins.setHost(att.getValue());
else if (att.getName().equals(Attributes.LOCATION)) ins.setDC(att.getValue());
else if (att.getName().equals(Attributes.UPDATE_TS))
ins.setUpdatetime(Long.parseLong(att.getValue()));
}
return ins;
}
代码示例来源:origin: aws/aws-sdk-java
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Attribute == false)
return false;
Attribute other = (Attribute) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getAlternateNameEncoding() == null ^ this.getAlternateNameEncoding() == null)
return false;
if (other.getAlternateNameEncoding() != null && other.getAlternateNameEncoding().equals(this.getAlternateNameEncoding()) == false)
return false;
if (other.getValue() == null ^ this.getValue() == null)
return false;
if (other.getValue() != null && other.getValue().equals(this.getValue()) == false)
return false;
if (other.getAlternateValueEncoding() == null ^ this.getAlternateValueEncoding() == null)
return false;
if (other.getAlternateValueEncoding() != null && other.getAlternateValueEncoding().equals(this.getAlternateValueEncoding()) == false)
return false;
return true;
}
代码示例来源:origin: aws/aws-sdk-java
if (attributesListValue.getName() != null) {
request.addParameter("Item." + itemsListIndex + ".Attribute." + attributesListIndex + ".Name",
StringUtils.fromString(attributesListValue.getName()));
代码示例来源:origin: aws/aws-sdk-java
if (attributesListValue.getName() != null) {
request.addParameter("Attribute." + attributesListIndex + ".Name", StringUtils.fromString(attributesListValue.getName()));
代码示例来源:origin: aws-amplify/aws-sdk-android
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getName() != null) sb.append("Name: " + getName() + ",");
if (getAlternateNameEncoding() != null) sb.append("AlternateNameEncoding: " + getAlternateNameEncoding() + ",");
if (getValue() != null) sb.append("Value: " + getValue() + ",");
if (getAlternateValueEncoding() != null) sb.append("AlternateValueEncoding: " + getAlternateValueEncoding() );
sb.append("}");
return sb.toString();
}
代码示例来源:origin: aws-amplify/aws-sdk-android
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getAlternateNameEncoding() == null) ? 0 : getAlternateNameEncoding().hashCode());
hashCode = prime * hashCode + ((getValue() == null) ? 0 : getValue().hashCode());
hashCode = prime * hashCode + ((getAlternateValueEncoding() == null) ? 0 : getAlternateValueEncoding().hashCode());
return hashCode;
}
代码示例来源:origin: aws-amplify/aws-sdk-android
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof Attribute == false) return false;
Attribute other = (Attribute)obj;
if (other.getName() == null ^ this.getName() == null) return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false) return false;
if (other.getAlternateNameEncoding() == null ^ this.getAlternateNameEncoding() == null) return false;
if (other.getAlternateNameEncoding() != null && other.getAlternateNameEncoding().equals(this.getAlternateNameEncoding()) == false) return false;
if (other.getValue() == null ^ this.getValue() == null) return false;
if (other.getValue() != null && other.getValue().equals(this.getValue()) == false) return false;
if (other.getAlternateValueEncoding() == null ^ this.getAlternateValueEncoding() == null) return false;
if (other.getAlternateValueEncoding() != null && other.getAlternateValueEncoding().equals(this.getAlternateValueEncoding()) == false) return false;
return true;
}
代码示例来源:origin: aws-amplify/aws-sdk-android
assertNotNull(attributes.getName());
assertTrue(attributes.getName().equals("1"));
代码示例来源:origin: aws-amplify/aws-sdk-android
assertNotNull(attributes.getName());
assertTrue(attributes.getName().equals("1"));
代码示例来源:origin: appoxy/simplejpa
private static String getValueToSet(List<Attribute> atts, String propertyName, String columnName) {
if(columnName != null) propertyName = columnName;
for (Attribute att : atts) {
String attName = att.getName();
if (attName.equals(propertyName)) {
String val = att.getValue();
return val;
}
}
return null;
}
代码示例来源:origin: org.teiid.connectors/connector-simpledb
private Map<String, List<String>> createAttributeMap(List<Attribute> attributes) {
Map<String, List<String>> map = new LinkedHashMap<String, List<String>>();
for (Attribute attribute : attributes) {
if (map.get(attribute.getName()) == null) {
List<String> list = new ArrayList<String>();
list.add(attribute.getValue());
map.put(attribute.getName(), list);
} else {
map.get(attribute.getName()).add(attribute.getValue());
}
}
return map;
}
}
代码示例来源:origin: appoxy/simplejpa
private static Collection<String> getValuesToSet(List<Attribute> atts, String propertyName, String columnName) {
Collection<String> values = new ArrayList<String>();
if(columnName != null) propertyName = columnName;
for (Attribute att : atts) {
String attName = att.getName();
if (attName.equals(propertyName)) {
values.add(att.getValue());
}
}
return values;
}
代码示例来源:origin: aws-amplify/aws-sdk-android
Attribute attributeMember = attributesListValue;
if (attributeMember != null) {
if (attributeMember.getName() != null) {
request.addParameter("Item." + itemsListIndex + ".Attribute." + attributesListIndex + ".Name", StringUtils.fromString(attributeMember.getName()));
代码示例来源:origin: appoxy/simplejpa
private static Set<String> getForeignKeys(EntityManagerSimpleJPA em, PersistentProperty getter, String columnName, List<Attribute> atts) {
String fkAttName = columnName != null ? columnName : NamingHelper.foreignKey(getter.getFieldName());
HashSet<String> keys = new HashSet<String>(atts.size());
for (Attribute att : atts) {
if (att.getName().equals(fkAttName)) {
keys.add(att.getValue());
}
}
return keys;
}
代码示例来源:origin: com.amazonaws/aws-java-sdk-simpledb
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getAlternateNameEncoding() == null) ? 0 : getAlternateNameEncoding().hashCode());
hashCode = prime * hashCode + ((getValue() == null) ? 0 : getValue().hashCode());
hashCode = prime * hashCode + ((getAlternateValueEncoding() == null) ? 0 : getAlternateValueEncoding().hashCode());
return hashCode;
}
代码示例来源:origin: aws-amplify/aws-sdk-android
Attribute attributeMember = attributesListValue;
if (attributeMember != null) {
if (attributeMember.getName() != null) {
request.addParameter("Attribute." + attributesListIndex + ".Name", StringUtils.fromString(attributeMember.getName()));
代码示例来源:origin: gofore/aws-training
@Override
public SearchItem apply(Item item) {
SearchItem si = new SearchItem(item.getName());
item.getAttributes().forEach(attr -> si.addAttribute(attr.getName(), attr.getValue()));
return si;
}
}
内容来源于网络,如有侵权,请联系作者删除!