Refine search
public Destination unmarshall(StaxUnmarshallerContext context) throws Exception { Destination destination = new Destination(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; destination.withToAddresses(new ArrayList<String>()); continue; destination.withToAddresses(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; destination.withCcAddresses(new ArrayList<String>()); continue; destination.withCcAddresses(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; destination.withBccAddresses(new ArrayList<String>()); continue; destination.withBccAddresses(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue;
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDestination() == null) ? 0 : getDestination().hashCode()); hashCode = prime * hashCode + ((getReplacementTags() == null) ? 0 : getReplacementTags().hashCode()); hashCode = prime * hashCode + ((getReplacementTemplateData() == null) ? 0 : getReplacementTemplateData().hashCode()); return hashCode; }
/** * <p> * The BCC: field(s) of the message. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setBccAddresses(java.util.Collection)} or {@link #withBccAddresses(java.util.Collection)} if you want to * override the existing values. * </p> * * @param bccAddresses * The BCC: field(s) of the message. * @return Returns a reference to this object so that method calls can be chained together. */ public Destination withBccAddresses(String... bccAddresses) { if (this.bccAddresses == null) { setBccAddresses(new com.amazonaws.internal.SdkInternalList<String>(bccAddresses.length)); } for (String ele : bccAddresses) { this.bccAddresses.add(ele); } return this; }
/** * <p> * The CC: field(s) of the message. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setCcAddresses(java.util.Collection)} or {@link #withCcAddresses(java.util.Collection)} if you want to * override the existing values. * </p> * * @param ccAddresses * The CC: field(s) of the message. * @return Returns a reference to this object so that method calls can be chained together. */ public Destination withCcAddresses(String... ccAddresses) { if (this.ccAddresses == null) { setCcAddresses(new com.amazonaws.internal.SdkInternalList<String>(ccAddresses.length)); } for (String ele : ccAddresses) { this.ccAddresses.add(ele); } return this; }
@Override public boolean sendEmail(List<String> emails, String subject, String body) { if (emails != null && !emails.isEmpty() && !StringUtils.isBlank(body)) { final SendEmailRequest request = new SendEmailRequest().withSource(Config.SUPPORT_EMAIL); Destination dest = new Destination().withToAddresses(emails); request.setDestination(dest); Content subjContent = new Content().withData(subject); Message msg = new Message().withSubject(subjContent); // Include a body in both text and HTML formats Content textContent = new Content().withData(body).withCharset(Config.DEFAULT_ENCODING); msg.setBody(new Body().withHtml(textContent)); request.setMessage(msg); Para.asyncExecute(new Runnable() { public void run() { sesclient.sendEmail(request); } }); return true; } return false; } }
@RunWith( HttpJUnitRunner.class ) public class RestfuseTest { @Rule public Destination destination = new Destination( "http://restfuse.com" ); @Context private Response response; // will be injected after every request @HttpTest( method = Method.GET, path = "/" ) public void checkRestfuseOnlineStatus() { assertOk( response ); } }
Iterator iterator= query.list().iterator(); Destination dest; ArrayList<Destination> destinations= new ArrayList<>(); Iterator iterator= query.list().iterator(); while(iterator.hasNext()){ Object[] tuple= (Object[]) iterator.next(); dest= new Destination(); dest.setId((String)tuple[0]); dest.setName((String)tuple[1]); dest.setLat((String)tuple[2]); dest.setLng((String)tuple[3]); destinations.add(dest); }
message.setBody(new Body(new Content(mailMessage.getText()).withCharset(Charsets.UTF_8.toString()))); Destination destination = new Destination(asList(mailMessage.getTo())); .ifPresent(cc -> destination.setCcAddresses(asList(cc))); .ifPresent(cc -> destination.setBccAddresses(asList(cc)));
// Destination[] destinations; ArrayList<Destination> destinationsList = new ArrayList<Destination>(); //add some destinations destinationsList.add(new Destination("1")); destinationsList.add(new Destination("2")); // ..... Object[] destinations = destinationsList.toArray(); destinations[1] = "2"; //simulate switching of one object in the converted array with object that is of other type then Destination for (Object object : destinations) { //we want to do something with Destionations Destination destination = (Destination) object; System.out.println(destination.getCode()); //exception thrown when second memeber of the array is processed }
public static void main(String[] args) throws Exception { Source d = new Source(); d.setProperty(Boolean.TRUE); BeanMap beanMap = new BeanMap(d); Destination s = new Destination(); BeanUtils.populate(s, beanMap); System.out.println("s.getProperty()=" + s.isProperty()); }
/** * <p> * The BCC: field(s) of the message. * </p> * * @param bccAddresses * The BCC: field(s) of the message. * @return Returns a reference to this object so that method calls can be chained together. */ public Destination withBccAddresses(java.util.Collection<String> bccAddresses) { setBccAddresses(bccAddresses); return this; }
/** * <p> * The CC: field(s) of the message. * </p> * * @param ccAddresses * The CC: field(s) of the message. * @return Returns a reference to this object so that method calls can be chained together. */ public Destination withCcAddresses(java.util.Collection<String> ccAddresses) { setCcAddresses(ccAddresses); return this; }
/** * <p> * The CC: field(s) of the message. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setCcAddresses(java.util.Collection)} or {@link #withCcAddresses(java.util.Collection)} if you want to * override the existing values. * </p> * * @param ccAddresses * The CC: field(s) of the message. * @return Returns a reference to this object so that method calls can be chained together. */ public Destination withCcAddresses(String... ccAddresses) { if (this.ccAddresses == null) { setCcAddresses(new com.amazonaws.internal.SdkInternalList<String>(ccAddresses.length)); } for (String ele : ccAddresses) { this.ccAddresses.add(ele); } return this; }
@Override public boolean sendEmail(List<String> emails, String subject, String body) { if (emails != null && !emails.isEmpty() && !StringUtils.isBlank(body)) { final SendEmailRequest request = new SendEmailRequest().withSource(Config.SUPPORT_EMAIL); Destination dest = new Destination().withToAddresses(emails); request.setDestination(dest); Content subjContent = new Content().withData(subject); Message msg = new Message().withSubject(subjContent); // Include a body in both text and HTML formats Content textContent = new Content().withData(body).withCharset(Config.DEFAULT_ENCODING); msg.setBody(new Body().withHtml(textContent)); request.setMessage(msg); Para.asyncExecute(new Runnable() { public void run() { sesclient.sendEmail(request); } }); return true; } return false; } }
@Rule public Destination destination = new Destination("http://localhost:8080/rest/"); @HttpTest( method = Method.GET, path = "/status" ,authentications = @Authentication(type = AuthenticationType.BASIC, user = "joe", password = "doe") ) public void testAuthRhqadmin() { com.eclipsesource.restfuse.Assert.assertOk(response); }
/** * <p> * The BCC: field(s) of the message. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param bccAddresses <p> * The BCC: field(s) of the message. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public Destination withBccAddresses(java.util.Collection<String> bccAddresses) { setBccAddresses(bccAddresses); return this; }
/** * <p> * The CC: field(s) of the message. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param ccAddresses <p> * The CC: field(s) of the message. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public Destination withCcAddresses(java.util.Collection<String> ccAddresses) { setCcAddresses(ccAddresses); return this; }
/** * <p> * The BCC: field(s) of the message. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setBccAddresses(java.util.Collection)} or {@link #withBccAddresses(java.util.Collection)} if you want to * override the existing values. * </p> * * @param bccAddresses * The BCC: field(s) of the message. * @return Returns a reference to this object so that method calls can be chained together. */ public Destination withBccAddresses(String... bccAddresses) { if (this.bccAddresses == null) { setBccAddresses(new com.amazonaws.internal.SdkInternalList<String>(bccAddresses.length)); } for (String ele : bccAddresses) { this.bccAddresses.add(ele); } return this; }
public Destination unmarshall(StaxUnmarshallerContext context) throws Exception { Destination destination = new Destination(); destination.withToAddresses(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue; destination.withCcAddresses(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue; destination.withBccAddresses(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue;
@Override public boolean sendEmail(List<String> emails, String subject, String body) { if (emails != null && !emails.isEmpty() && !StringUtils.isBlank(body)) { final SendEmailRequest request = new SendEmailRequest().withSource(Config.SUPPORT_EMAIL); Destination dest = new Destination().withToAddresses(emails); request.setDestination(dest); Content subjContent = new Content().withData(subject); Message msg = new Message().withSubject(subjContent); // Include a body in both text and HTML formats Content textContent = new Content().withData(body).withCharset(Config.DEFAULT_ENCODING); msg.setBody(new Body().withHtml(textContent)); request.setMessage(msg); Utils.asyncExecute(new Runnable() { public void run() { sesclient.sendEmail(request); } }); return true; } return false; } }