it.auties.whatsapp.model.button.template.highlyStructured.HighlyStructuredDateTimeComponentDayOfWeekSpec Maven / Gradle / Ivy
package it.auties.whatsapp.model.button.template.highlyStructured;
import it.auties.whatsapp.model.button.template.highlyStructured.HighlyStructuredDateTimeComponent.DayOfWeek;
import java.util.Arrays;
import java.util.Optional;
public class HighlyStructuredDateTimeComponentDayOfWeekSpec {
public static Integer encode(DayOfWeek protoInputObject) {
if(protoInputObject == null) {
return null;
}
return protoInputObject.index;
}
public static Optional decode(int index) {
return Arrays.stream(DayOfWeek.values())
.filter(entry -> entry.index == index)
.findFirst();
}
}