1 package net.pterodactylus.rhynodge.utils
3 import com.google.common.base.Optional
5 fun <T> T?.asOptional(): Optional<T> = Optional.fromNullable(this)
6 fun String?.asOptional(): Optional<String> = if ((this == null) || (this.isEmpty())) Optional.absent() else Optional.of(this)