This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.yammer.dropwizard.validation; | |
import com.google.common.base.Joiner; | |
import com.google.common.collect.*; | |
import org.hibernate.validator.internal.engine.ConstraintValidatorFactoryImpl; | |
import javax.validation.*; | |
import javax.validation.groups.Default; | |
import java.util.Set; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UnknownHostException(hostname: String) extends RuntimeException(s"Unknown host: $hostname") | |
object NetworkAddress { | |
def apply(address: String): Option[NetworkAddress] = address match { | |
case addr @ IPv4NetworkAddress.pattern(_, _, _, _) => Some(new IPv4NetworkAddress(addr) {}) | |
case addr @ IPv6NetworkAddress.pattern(_, _, _, _, _, _, _, _) => Some(new IPv6NetworkAddress(addr) {}) | |
case addr @ UnresolvedNetworkAddress.pattern() => Some(new UnresolvedNetworkAddress(addr) {}) | |
case _ => None | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Option[A] = A | Null | |
object Option { | |
inline def apply[A](x: A): Option[A] = x | |
} | |
implicit class OptionMethods[A](val x: Option[A]) extends AnyVal { | |
inline def map[B](f: A => B): Option[A] = x match { | |
case null => null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
set -eEuo pipefail # "strict" mode (http://redsymbol.net/articles/unofficial-bash-strict-mode/) | |
export SHELLOPTS # propagate strict mode to all subshells | |
# don't split words on space characters | |
IFS=$'\n\t' | |
# absolute path of the directory the invoked script resides in | |
BASE_PATH="${BASE_PATH:-$(dirname -- "$(readlink -f "${BASH_SOURCE[0]}")")}" |
OlderNewer