@Test void testForwarded() { final Forwarded forwarded = Forwarded.valueOf("by=1.2.3.4;for=9.8.7.6;host=example.com;proto=https"); assertEquals(of("1.2.3.4"), forwarded.getBy()); assertEquals(of("9.8.7.6"), forwarded.getFor()); assertEquals(of("example.com"), forwarded.getHost()); assertEquals(of("https"), forwarded.getProto()); }
public Forwarded(final String forwardedBy, final String forwardedFor, final String forwardedHost, final String forwardedProto) { this.forwardedBy = forwardedBy; this.forwardedFor = forwardedFor; this.forwardedHost = forwardedHost; this.forwardedProto = checkProto(forwardedProto); if (forwardedHost != null) { final String[] parts = forwardedHost.split(":", 2); this.hostname = parts[0]; this.port = parts.length == 2 && !parts[1].isEmpty() ? parts[1] : "-1"; } else { this.hostname = forwardedHost; this.port = forwardedHost; } }
Forwarded { public Forwarded(final String forwardedBy, final String forwardedFor, final String forwardedHost, final String forwardedProto) { this.forwardedBy = forwardedBy; this.forwardedFor = forwardedFor; this.forwardedHost = forwardedHost; this.forwardedProto = checkProto(forwardedProto); if (forwardedHost != null) { final String[] parts = forwardedHost.split(":", 2); this.hostname = parts[0]; this.port = parts.length == 2 && !parts[1].isEmpty() ? parts[1] : "-1"; } else { this.hostname = forwardedHost; this.port = forwardedHost; } } }
Forwarded { public Forwarded(final String forwardedBy, final String forwardedFor, final String forwardedHost, final String forwardedProto) { this.forwardedBy = forwardedBy; this.forwardedFor = forwardedFor; this.forwardedHost = forwardedHost; this.forwardedProto = checkProto(forwardedProto); if (forwardedHost != null) { final String[] parts = forwardedHost.split(":", 2); this.hostname = parts[0]; this.port = parts.length == 2 && !parts[1].isEmpty() ? parts[1] : "-1"; } else { this.hostname = forwardedHost; this.port = forwardedHost; } } Forwarded(final String forwardedBy, final String forwardedFor, final String forwardedHost,
            final String forwardedProto); }
Forwarded { public Forwarded(final String forwardedBy, final String forwardedFor, final String forwardedHost, final String forwardedProto) { this.forwardedBy = forwardedBy; this.forwardedFor = forwardedFor; this.forwardedHost = forwardedHost; this.forwardedProto = checkProto(forwardedProto); if (forwardedHost != null) { final String[] parts = forwardedHost.split(":", 2); this.hostname = parts[0]; this.port = parts.length == 2 && !parts[1].isEmpty() ? parts[1] : "-1"; } else { this.hostname = forwardedHost; this.port = forwardedHost; } } Forwarded(final String forwardedBy, final String forwardedFor, final String forwardedHost,
            final String forwardedProto); Optional<String> getBy(); Optional<String> getFor(); Optional<String> getHost(); Optional<String> getProto(); OptionalInt getPort(); Optional<String> getHostname(); static Forwarded valueOf(final String value); }
Forwarded { public Forwarded(final String forwardedBy, final String forwardedFor, final String forwardedHost, final String forwardedProto) { this.forwardedBy = forwardedBy; this.forwardedFor = forwardedFor; this.forwardedHost = forwardedHost; this.forwardedProto = checkProto(forwardedProto); if (forwardedHost != null) { final String[] parts = forwardedHost.split(":", 2); this.hostname = parts[0]; this.port = parts.length == 2 && !parts[1].isEmpty() ? parts[1] : "-1"; } else { this.hostname = forwardedHost; this.port = forwardedHost; } } Forwarded(final String forwardedBy, final String forwardedFor, final String forwardedHost,
            final String forwardedProto); Optional<String> getBy(); Optional<String> getFor(); Optional<String> getHost(); Optional<String> getProto(); OptionalInt getPort(); Optional<String> getHostname(); static Forwarded valueOf(final String value); static final String HTTP; static final String HTTPS; }