@Test public void updateContentTest(){ SessionCredentials sessionCredentials=new SessionCredentials(); Properties properties=new Properties(); properties.setProperty(SessionCredentials.ACCESS_KEY,"RocketMQ"); properties.setProperty(SessionCredentials.SECRET_KEY,"12345678"); properties.setProperty(SessionCredentials.SECURITY_TOKEN,"abcd"); sessionCredentials.updateContent(properties); }
public void updateContent(Properties prop) { { String value = prop.getProperty(ACCESS_KEY); if (value != null) { this.accessKey = value.trim(); } } { String value = prop.getProperty(SECRET_KEY); if (value != null) { this.secretKey = value.trim(); } } { String value = prop.getProperty(SECURITY_TOKEN); if (value != null) { this.securityToken = value.trim(); } } }
SessionCredentials { public void updateContent(Properties prop) { { String value = prop.getProperty(ACCESS_KEY); if (value != null) { this.accessKey = value.trim(); } } { String value = prop.getProperty(SECRET_KEY); if (value != null) { this.secretKey = value.trim(); } } { String value = prop.getProperty(SECURITY_TOKEN); if (value != null) { this.securityToken = value.trim(); } } } }
SessionCredentials { public void updateContent(Properties prop) { { String value = prop.getProperty(ACCESS_KEY); if (value != null) { this.accessKey = value.trim(); } } { String value = prop.getProperty(SECRET_KEY); if (value != null) { this.secretKey = value.trim(); } } { String value = prop.getProperty(SECURITY_TOKEN); if (value != null) { this.securityToken = value.trim(); } } } SessionCredentials();  SessionCredentials(String accessKey, String secretKey);  SessionCredentials(String accessKey, String secretKey, String securityToken); }
SessionCredentials { public void updateContent(Properties prop) { { String value = prop.getProperty(ACCESS_KEY); if (value != null) { this.accessKey = value.trim(); } } { String value = prop.getProperty(SECRET_KEY); if (value != null) { this.secretKey = value.trim(); } } { String value = prop.getProperty(SECURITY_TOKEN); if (value != null) { this.securityToken = value.trim(); } } } SessionCredentials();  SessionCredentials(String accessKey, String secretKey);  SessionCredentials(String accessKey, String secretKey, String securityToken); void updateContent(Properties prop); String getAccessKey(); void setAccessKey(String accessKey); String getSecretKey(); void setSecretKey(String secretKey); String getSignature(); void setSignature(String signature); String getSecurityToken(); void setSecurityToken(final String securityToken); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
SessionCredentials { public void updateContent(Properties prop) { { String value = prop.getProperty(ACCESS_KEY); if (value != null) { this.accessKey = value.trim(); } } { String value = prop.getProperty(SECRET_KEY); if (value != null) { this.secretKey = value.trim(); } } { String value = prop.getProperty(SECURITY_TOKEN); if (value != null) { this.securityToken = value.trim(); } } } SessionCredentials();  SessionCredentials(String accessKey, String secretKey);  SessionCredentials(String accessKey, String secretKey, String securityToken); void updateContent(Properties prop); String getAccessKey(); void setAccessKey(String accessKey); String getSecretKey(); void setSecretKey(String secretKey); String getSignature(); void setSignature(String signature); String getSecurityToken(); void setSecurityToken(final String securityToken); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static final Charset CHARSET; static final String ACCESS_KEY; static final String SECRET_KEY; static final String SIGNATURE; static final String SECURITY_TOKEN; static final String KEY_FILE; }