From d3f083e0d5a8dc05f8df393d3deac4ebf1d0114e Mon Sep 17 00:00:00 2001 From: Nekojimi Date: Thu, 30 Sep 2021 17:05:31 +0100 Subject: [PATCH] Added query class. --- .../moe/nekojimi/musicsearcher/Query.java | 33 +++++++++++++++++++ .../QueryFieldUnsupportedException.java | 22 +++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 src/main/java/moe/nekojimi/musicsearcher/Query.java create mode 100644 src/main/java/moe/nekojimi/musicsearcher/QueryFieldUnsupportedException.java diff --git a/src/main/java/moe/nekojimi/musicsearcher/Query.java b/src/main/java/moe/nekojimi/musicsearcher/Query.java new file mode 100644 index 0000000..88fac19 --- /dev/null +++ b/src/main/java/moe/nekojimi/musicsearcher/Query.java @@ -0,0 +1,33 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.musicsearcher; + +/** + * + * @author jim + */ +public class Query +{ + private String textSearch; + + public static Query fullText(String text) + { + Query query = new Query(); + query.setTextSearch(text); + return query; + } + + public String getTextSearch() + { + return textSearch; + } + + public void setTextSearch(String textSearch) + { + this.textSearch = textSearch; + } + +} diff --git a/src/main/java/moe/nekojimi/musicsearcher/QueryFieldUnsupportedException.java b/src/main/java/moe/nekojimi/musicsearcher/QueryFieldUnsupportedException.java new file mode 100644 index 0000000..0b3efa1 --- /dev/null +++ b/src/main/java/moe/nekojimi/musicsearcher/QueryFieldUnsupportedException.java @@ -0,0 +1,22 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.musicsearcher; + +/** + * + * @author jim + */ +public class QueryFieldUnsupportedException extends RuntimeException +{ + private final String field; + + public QueryFieldUnsupportedException(String field) + { + super("Searcher doesn't support query field: " + field); + this.field = field; + } + +}