package loc.filter.filters.TimeModified;

import loc.filter.FilterSerializer;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.concurrent.TimeUnit;

public class LaterModified extends TimeModifiedFilter {
    public static final char prefix = '>';
    public LaterModified(long lowerBound) {
        super(lowerBound);
    }


	public static class Serializer implements FilterSerializer {
		@Override
		public LaterModified parse(String string) throws Exception {
			String timestampString = new loc.Parser(string)
					.skipSpaces()
					.skipChar(prefix)
					.skipSpaces()
					.readToTheEnd();
			return new LaterModified(Long.parseLong(timestampString));
		}

		@Override
		public String serialize() throws Exception {
			return null;
		}
	}

	@Override
	public FilterSerializer getSerializer() {
		return new Serializer();
	}

	@Override
	public boolean check(Path file) throws IOException {
		long lastModified = Files.getLastModifiedTime(file).to(TimeUnit.SECONDS);
		return lastModified > timeBound;
	}

	@Override
	public char getPrefix() {
		return prefix;
	}
}

@@ -35,16 +35,42 @@
 ified;%0A%0A
+import loc.filter.Filter;%0A
 import l
@@ -233,29 +233,24 @@
 c class 
-Later
 Modified
  extends
@@ -241,16 +241,21 @@
 Modified
+Later
  extends
@@ -323,86 +323,8 @@
 %3E';%0A
-    public LaterModified(long lowerBound) %7B%0A        super(lowerBound);%0A    %7D%0A%0A
 %0A%09pu
@@ -403,29 +403,24 @@
 %09public 
-Later
 Modified
  parse(S
@@ -411,16 +411,21 @@
 Modified
+Later
  parse(S
@@ -609,21 +609,16 @@
 new 
-Later
 Modified
 (Lon
@@ -613,16 +613,21 @@
 Modified
+Later
 (Long.pa
@@ -696,16 +696,29 @@
 rialize(
+Filter filter
 ) throws
@@ -744,17 +744,146 @@
 urn 
-null;%0A%09%09%7D
+String.valueOf(prefix) + ModifiedLater.class.cast(filter).timeBound;%0A%09%09%7D%0A%09%7D%0A%0A%09public ModifiedLater(long lowerBound) %7B%0A%09%09super(lowerBound);
 %0A%09%7D%0A

Rename LaterModified to ModifiedLater Implement ModifiedLater.Serializer.serialize() Refactor