// local variable initialization
Map<String, Object> attributes =
getAllAttributes(pubSubMessage.topic(), eventObj, pubSubMessage.id());
var attributes =
getAllAttributes(pubSubMessage.topic(), eventObj, pubSubMessage.id());
// for loops
public EntityWithEvents<I, ESE> add(Event... events) {
for (Event event : events) {
for (var event: events) {}
for (int i = 0; i < EVENTS_PER_ROW; i++) {
for (var i = 0; i < EVENTS_PER_ROW; i++) {
// try with resources
try (ServerSocket serverSocket = new ServerSocket(0))
try (var serverSocker = new ServerSocker(0))
var multiLineString = """
In Java, strings are objects too,
They're created with the keyword "new"
You can use them, concatenate,
with the plus sign they'll inflate,
to make a sentence, long and true.
""";
Day day = Day.WEDNESDAY;
int numLetters = switch (day) {
case MONDAY:
case FRIDAY:
case SUNDAY:
System.out.println(6);
yield 6;
case TUESDAY:
System.out.println(7);
yield 7;
case THURSDAY:
case SATURDAY:
System.out.println(8);
yield 8;
case WEDNESDAY:
System.out.println(9);
yield 9;
default:
throw new IllegalStateException("Invalid day: " + day);
};
System.out.println(numLetters);
package com.wayfair.canon.loader.events;
import com.fasterxml.jackson.annotation.JsonProperty;
public record SalesforceAccountEvent(
@JsonProperty("CreatedDate")
String modifiedTime,
@JsonProperty("CreatedById")
String user,
@JsonProperty("BaID__c")
String baid,
@JsonProperty("Name__c")
String companyName,
@JsonProperty("Status__c")
String status,
@JsonProperty("Industry__c")
String industry,
@JsonProperty("Domain__c")
String registeredDomain,
@JsonProperty("Region__c")
String region,
@JsonProperty("Company_state__c")
String state,
@JsonProperty("Phone__c")
String phone
) implements SalesforceEvent { }