// Path: src/main/java/net/seleucus/wsp/server/request/domain/HttpMethod.java
// public enum HttpMethod {
// 
//     GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE, CONNECT;
// }
// 
// Path: src/main/java/net/seleucus/wsp/server/request/domain/LogMessage.java
// public class LogMessage {
// 
//     private final String ipAddress;
//     private final String userId;
//     private final long timestamp;
//     private final HttpMethod httpMethod;
//     private final String requestUri;
//     private final HttpVersion httpVersion;
//     private final int responseCode;
//     private final long responseSizeBytes;
// 
//     public LogMessage(final String ipAddress, final String userId, final long timestamp, final HttpMethod httpMethod,
//                       final String requestUri, final HttpVersion httpVersion, final int responseCode,
//                       final long responseSizeBytes) {
//         this.ipAddress = ipAddress;
//         this.userId = userId;
//         this.timestamp = timestamp;
//         this.httpMethod = httpMethod;
//         this.requestUri = requestUri;
//         this.httpVersion = httpVersion;
//         this.responseCode = responseCode;
//         this.responseSizeBytes = responseSizeBytes;
//     }
// 
//     public String getIpAddress() {
//         return ipAddress;
//     }
// 
//     public String getUserId() {
//         return userId;
//     }
// 
//     public long getTimestamp() {
//         return timestamp;
//     }
// 
//     public HttpMethod getHttpMethod() {
//         return httpMethod;
//     }
// 
//     public String getRequestUri() {
//         return requestUri;
//     }
// 
//     public HttpVersion getHttpVersion() {
//         return httpVersion;
//     }
// 
//     public int getResponseCode() {
//         return responseCode;
//     }
// 
//     public long getResponseSizeBytes() {
//         return responseSizeBytes;
//     }
// 
//     @Override
//     public String toString() {
//         return ReflectionToStringBuilder.toString(this);
//     }
// 
//     public static class LogMessageBuilder {
//         private String ipAddress;
//         private String userId;
//         private long timestamp;
//         private HttpMethod httpMethod;
//         private String requestUri;
//         private HttpVersion httpVersion;
//         private int responseCode;
//         private long responseSizeBytes;
// 
//         public static LogMessageBuilder createLogMessage(){
//             return new LogMessageBuilder();
//         }
// 
//         public LogMessageBuilder withIpAddress(final String ipAddress) {
//             this.ipAddress = ipAddress;
//             return this;
//         }
// 
//         public LogMessageBuilder withUserId(final String userId) {
//             this.userId = userId;
//             return this;
//         }
// 
//         public LogMessageBuilder withTimestamp(final long timestamp) {
//             this.timestamp = timestamp;
//             return this;
//         }
// 
//         public LogMessageBuilder withHttpMethod(final HttpMethod httpMethod) {
//             this.httpMethod = httpMethod;
//             return this;
//         }
// 
//         public LogMessageBuilder withRequestUri(final String requestUri) {
//             this.requestUri = requestUri;
//             return this;
//         }
// 
//         public LogMessageBuilder withHttpVersion(final HttpVersion httpVersion) {
//             this.httpVersion = httpVersion;
//             return this;
//         }
// 
//         public LogMessageBuilder withResponseCode(final int responseCode) {
//             this.responseCode = responseCode;
//             return this;
//         }
// 
//         public LogMessageBuilder withResponseSizeBytes(final long responseSizeBytes) {
//             this.responseSizeBytes = responseSizeBytes;
//             return this;
//         }
// 
//         public LogMessage build(){
//             return new LogMessage(ipAddress, userId, timestamp, httpMethod, requestUri, httpVersion, responseCode, responseSizeBytes);
//         }
//     }
// }
// 
// Path: src/main/java/net/seleucus/wsp/server/request/filter/FilterResult.java
// public enum FilterResult {
//     DROP, ACCEPT;
// 
//     public static boolean resultIsDrop(final FilterResult filterResult){
//         return DROP == filterResult;
//     }
// 
//     public static FilterResult evaluateCondition(boolean condition){
//         return condition ? ACCEPT : DROP;
//     }
// }
// 
// Path: src/main/java/net/seleucus/wsp/server/request/filter/WebLogFilter.java
// public interface WebLogFilter {
// 
//     FilterResult parse(LogMessage logMessage);
// 
// }


import com.google.common.collect.ImmutableSet;
import net.seleucus.wsp.server.request.domain.HttpMethod;
import net.seleucus.wsp.server.request.domain.LogMessage;
import net.seleucus.wsp.server.request.filter.FilterResult;
import net.seleucus.wsp.server.request.filter.WebLogFilter;
import java.util.Set;
package net.seleucus.wsp.server.request.filter.filters;



public class HttpMethodWebLogFilter implements WebLogFilter {

    private final Set<HttpMethod> allowedHttpMethods;

    public HttpMethodWebLogFilter(Set<HttpMethod> allowedHttpMethods) {
        this.allowedHttpMethods = ImmutableSet.copyOf(allowedHttpMethods);
    }

    @Override
    public FilterResult parse(LogMessage logMessage) {
// Path: src/main/java/net/seleucus/wsp/server/request/domain/HttpMethod.java
// public enum HttpMethod {
// 
//     GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE, CONNECT;
// }
// 
// Path: src/main/java/net/seleucus/wsp/server/request/domain/LogMessage.java
// public class LogMessage {
// 
//     private final String ipAddress;
//     private final String userId;
//     private final long timestamp;
//     private final HttpMethod httpMethod;
//     private final String requestUri;
//     private final HttpVersion httpVersion;
//     private final int responseCode;
//     private final long responseSizeBytes;
// 
//     public LogMessage(final String ipAddress, final String userId, final long timestamp, final HttpMethod httpMethod,
//                       final String requestUri, final HttpVersion httpVersion, final int responseCode,
//                       final long responseSizeBytes) {
//         this.ipAddress = ipAddress;
//         this.userId = userId;
//         this.timestamp = timestamp;
//         this.httpMethod = httpMethod;
//         this.requestUri = requestUri;
//         this.httpVersion = httpVersion;
//         this.responseCode = responseCode;
//         this.responseSizeBytes = responseSizeBytes;
//     }
// 
//     public String getIpAddress() {
//         return ipAddress;
//     }
// 
//     public String getUserId() {
//         return userId;
//     }
// 
//     public long getTimestamp() {
//         return timestamp;
//     }
// 
//     public HttpMethod getHttpMethod() {
//         return httpMethod;
//     }
// 
//     public String getRequestUri() {
//         return requestUri;
//     }
// 
//     public HttpVersion getHttpVersion() {
//         return httpVersion;
//     }
// 
//     public int getResponseCode() {
//         return responseCode;
//     }
// 
//     public long getResponseSizeBytes() {
//         return responseSizeBytes;
//     }
// 
//     @Override
//     public String toString() {
//         return ReflectionToStringBuilder.toString(this);
//     }
// 
//     public static class LogMessageBuilder {
//         private String ipAddress;
//         private String userId;
//         private long timestamp;
//         private HttpMethod httpMethod;
//         private String requestUri;
//         private HttpVersion httpVersion;
//         private int responseCode;
//         private long responseSizeBytes;
// 
//         public static LogMessageBuilder createLogMessage(){
//             return new LogMessageBuilder();
//         }
// 
//         public LogMessageBuilder withIpAddress(final String ipAddress) {
//             this.ipAddress = ipAddress;
//             return this;
//         }
// 
//         public LogMessageBuilder withUserId(final String userId) {
//             this.userId = userId;
//             return this;
//         }
// 
//         public LogMessageBuilder withTimestamp(final long timestamp) {
//             this.timestamp = timestamp;
//             return this;
//         }
// 
//         public LogMessageBuilder withHttpMethod(final HttpMethod httpMethod) {
//             this.httpMethod = httpMethod;
//             return this;
//         }
// 
//         public LogMessageBuilder withRequestUri(final String requestUri) {
//             this.requestUri = requestUri;
//             return this;
//         }
// 
//         public LogMessageBuilder withHttpVersion(final HttpVersion httpVersion) {
//             this.httpVersion = httpVersion;
//             return this;
//         }
// 
//         public LogMessageBuilder withResponseCode(final int responseCode) {
//             this.responseCode = responseCode;
//             return this;
//         }
// 
//         public LogMessageBuilder withResponseSizeBytes(final long responseSizeBytes) {
//             this.responseSizeBytes = responseSizeBytes;
//             return this;
//         }
// 
//         public LogMessage build(){
//             return new LogMessage(ipAddress, userId, timestamp, httpMethod, requestUri, httpVersion, responseCode, responseSizeBytes);
//         }
//     }
// }
// 
// Path: src/main/java/net/seleucus/wsp/server/request/filter/FilterResult.java
// public enum FilterResult {
//     DROP, ACCEPT;
// 
//     public static boolean resultIsDrop(final FilterResult filterResult){
//         return DROP == filterResult;
//     }
// 
//     public static FilterResult evaluateCondition(boolean condition){
//         return condition ? ACCEPT : DROP;
//     }
// }
// 
// Path: src/main/java/net/seleucus/wsp/server/request/filter/WebLogFilter.java
// public interface WebLogFilter {
// 
//     FilterResult parse(LogMessage logMessage);
// 
// }


// Path: src/main/java/net/seleucus/wsp/server/request/filter/filters/HttpMethodWebLogFilter.java
import com.google.common.collect.ImmutableSet;
import net.seleucus.wsp.server.request.domain.HttpMethod;
import net.seleucus.wsp.server.request.domain.LogMessage;
import net.seleucus.wsp.server.request.filter.FilterResult;
import net.seleucus.wsp.server.request.filter.WebLogFilter;
import java.util.Set;

package net.seleucus.wsp.server.request.filter.filters;



public class HttpMethodWebLogFilter implements WebLogFilter {

    private final Set<HttpMethod> allowedHttpMethods;

    public HttpMethodWebLogFilter(Set<HttpMethod> allowedHttpMethods) {
        this.allowedHttpMethods = ImmutableSet.copyOf(allowedHttpMethods);
    }

    @Override
    public FilterResult parse(LogMessage logMessage) {
        return FilterResult.evaluateCondition(allowedHttpMethods.contains(logMessage.getHttpMethod()));