All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.auties.whatsapp.model.info.PaymentInfoCurrencySpec Maven / Gradle / Ivy

package it.auties.whatsapp.model.info;

import it.auties.whatsapp.model.info.PaymentInfo.Currency;
import java.util.Arrays;
import java.util.Optional;

public class PaymentInfoCurrencySpec {
    public static Integer encode(Currency protoInputObject) {
      if(protoInputObject == null) {
         return null;
      }
      return protoInputObject.index;
    }

    public static Optional decode(int index) {
        return Arrays.stream(Currency.values())
                .filter(entry -> entry.index == index)
                .findFirst();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy