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 EarlierModified extends TimeModifiedFilter {
    public static final char prefix = '<';

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

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

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

	public EarlierModified(long upperBound) {
        super(upperBound);
    }

	@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,31 +233,24 @@
 c class 
-Earlier
 Modified
  extends
@@ -241,16 +241,23 @@
 Modified
+Earlier
  extends
@@ -405,31 +405,24 @@
 %09public 
-Earlier
 Modified
  parse(S
@@ -413,16 +413,23 @@
 Modified
+Earlier
  parse(S
@@ -609,31 +609,24 @@
 urn new 
-Earlier
 Modified
 (Long.pa
@@ -617,16 +617,23 @@
 Modified
+Earlier
 (Long.pa
@@ -702,16 +702,29 @@
 rialize(
+Filter filter
 ) throws
@@ -750,17 +750,148 @@
 urn 
-null;%0A%09%09%7D
+String.valueOf(prefix) + ModifiedLater.class.cast(filter).timeBound;%0A%09%09%7D%0A%09%7D%0A%0A%09public ModifiedEarlier(long upperBound) %7B%0A%09%09super(upperBound);
 %0A%09%7D%0A
@@ -980,85 +980,8 @@
 %09%7D%0A%0A
-%09public EarlierModified(long upperBound) %7B%0A        super(upperBound);%0A    %7D%0A%0A
 %09@Ov

Rename EarlierModified to ModifiedEarlier Implement ModifiedEarlier.Serializer.serialize() Refactor