PlotSquared/Core/src/test/java/com/plotsquared/core/database/AbstractDBTest.java

227 lines
6.2 KiB
Java
Raw Normal View History

/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2020 IntellectualSites
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2020-04-15 21:26:54 +02:00
package com.plotsquared.core.database;
import com.plotsquared.core.plot.flag.PlotFlag;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.PlotCluster;
import com.plotsquared.core.plot.PlotId;
import com.plotsquared.core.util.task.RunnableVal;
import com.plotsquared.core.plot.comment.PlotComment;
2019-09-08 20:02:45 +02:00
import org.jetbrains.annotations.NotNull;
2016-05-05 19:39:54 +02:00
2019-09-08 20:02:45 +02:00
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
2016-05-05 19:41:11 +02:00
public class AbstractDBTest implements AbstractDB {
2018-08-10 17:01:10 +02:00
@Override public void setOwner(Plot plot, UUID uuid) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void createPlotsAndData(List<Plot> plots, Runnable whenDone) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void createPlotSafe(Plot plot, Runnable success, Runnable failure) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void createTables() {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void delete(Plot plot) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void deleteSettings(Plot plot) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void deleteHelpers(Plot plot) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void deleteTrusted(Plot plot) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void deleteDenied(Plot plot) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void deleteComments(Plot plot) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void deleteRatings(Plot plot) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void delete(PlotCluster cluster) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void addPersistentMeta(UUID uuid, String key, byte[] meta, boolean delete) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void removePersistentMeta(UUID uuid, String key) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void getPersistentMeta(UUID uuid, RunnableVal<Map<String, byte[]>> result) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void createPlotSettings(int id, Plot plot) {
}
2016-05-05 19:41:11 +02:00
@Override public int getId(Plot plot) {
return 0;
}
@Override public int getClusterId(PlotCluster cluster) {
return 0;
}
Pull/2693 (#2694) * Commit WIP flag work. * More ported flag types, and additions to the flag API. * Make PlotFlag more generic to allow generic flag creation * Pull Captions methods into a Caption interface. * Port MusicFlag * Port flight flag * Port UntrustedVisitFlag * Port DenyExitFlag * Remove paper suggestion * Make ListFlag lists immutable * Update Flag containers. Add javadocs. Add missing methods. * Port description flag * Port greeting and farewell flags * Port weather flag * Move getExample implementation to BooleanFlag * Port reserved flags * Port all boolean flags. * Remove unused flag types * Invert liquid-flow flag * Find the real (legacy) flag name * Change NOITFY -> NOTIFY in Captions * Make IntegerFlag extendable * Port integer flags * Update Flag command to current API state * Begin remaking flag command * Create DoubleFlag + extract common parsing stuff * Supply arguments in flag parse exceptions * Implement missing flag subcommands * Update Flag command to current API state * Implement PriceFlag * Port deny-teleport * Port gamemode flags * Port BreakFlag * Port PlaceFlag * Port UseFlag * Remove old unused flag constants * Port blocked-cmds flag * Fix entity util * Port TimeFlag * Use CaptionUtility for formatting * Port keep flag * Fix imports * Reformat code * Remove unused classes * Fix MainUtil.java * Remove FlagCmd * Add flag info header and footer * Comment out flag related stuff in SchematicHandler * Remove FlagManager * Finalize Plot.java * Finalize PlotArea.java * Finalize PlotListener * Fix API issues * Fix a bunch of compile errors * Fix `/plot flag remove` * Fix initialization of GlobalFlagContainer * Apply API changes to events * Update SQLManager to new API * Invert default value for DenyExitFlag * Replace flag.getValue().toString() with flag.toString() * Make FlagContainer instance in Plot final * Fix various command issues * Clean up PlotSettings * Don't show internal flags in flag list * Fix `/plot flag add` * Remove the info inventory as it's 100% broken * Add plot info entries and fix up the default format * Fix default flag state in Captions * 781c200 part 2 * Fix odd grammar in captions * Fix odd grammar in captions v2 * Add create table statements for plot_flags * Remove old flag references in SQLManager * Use the new plot_flags table * Add tab completion to `/plot flag` * Improve parse error handling * Make flag permission check recognize parse exceptions * Initial progress towards flag conversion * Fix minor issues * Don't validate flags during flag conversion * Allow unrecognized flags to be parsed * Filter out internal flags from command sugguestions * Use the wrong caption when there's no plot description set * Limit command suggestions for boolean flags * Make blocktypelistflags accept blockcategories * Require categories to be prefixed with '#' and fix some minor display issues * Fix plot database conversion * Update PlotFlagEvent.java Updated return description * Fix command annotation wrapping * Add FLAG_UPDATE event for FlagContainer listeners * Make getParentContainer nullable * Document castUnsafe in FlagContainer * Document FlagContainer constructors * Add missing documentation to FlagContainer * Document FlagParseException * Fix wording in FlagContainer javadoc * Document InternalFlag * Document PlotFlag * Minor changes * Remove revisit comments Co-authored-by: Hannes Greule <SirYwell@users.noreply.github.com> Co-authored-by: NotMyFault <mc.cache@web.de> Co-authored-by: Matt <4009945+MattBDev@users.noreply.github.com>
2020-02-24 18:42:02 +01:00
@Override public boolean convertFlags() {
return true;
}
2016-05-05 19:41:11 +02:00
@Override public HashMap<String, HashMap<PlotId, Plot>> getPlots() {
return null;
}
2018-08-10 17:01:10 +02:00
@Override public void validateAllPlots(Set<Plot> toValidate) {
}
2016-05-05 19:41:11 +02:00
@Override public HashMap<String, Set<PlotCluster>> getClusters() {
return null;
}
2018-08-10 17:01:10 +02:00
@Override public void setMerged(Plot plot, boolean[] merged) {
}
2016-05-05 19:41:11 +02:00
@Override public CompletableFuture<Boolean> swapPlots(Plot plot1, Plot plot2) {
return CompletableFuture.completedFuture(true);
2018-08-10 17:01:10 +02:00
}
2016-05-05 19:41:11 +02:00
Pull/2693 (#2694) * Commit WIP flag work. * More ported flag types, and additions to the flag API. * Make PlotFlag more generic to allow generic flag creation * Pull Captions methods into a Caption interface. * Port MusicFlag * Port flight flag * Port UntrustedVisitFlag * Port DenyExitFlag * Remove paper suggestion * Make ListFlag lists immutable * Update Flag containers. Add javadocs. Add missing methods. * Port description flag * Port greeting and farewell flags * Port weather flag * Move getExample implementation to BooleanFlag * Port reserved flags * Port all boolean flags. * Remove unused flag types * Invert liquid-flow flag * Find the real (legacy) flag name * Change NOITFY -> NOTIFY in Captions * Make IntegerFlag extendable * Port integer flags * Update Flag command to current API state * Begin remaking flag command * Create DoubleFlag + extract common parsing stuff * Supply arguments in flag parse exceptions * Implement missing flag subcommands * Update Flag command to current API state * Implement PriceFlag * Port deny-teleport * Port gamemode flags * Port BreakFlag * Port PlaceFlag * Port UseFlag * Remove old unused flag constants * Port blocked-cmds flag * Fix entity util * Port TimeFlag * Use CaptionUtility for formatting * Port keep flag * Fix imports * Reformat code * Remove unused classes * Fix MainUtil.java * Remove FlagCmd * Add flag info header and footer * Comment out flag related stuff in SchematicHandler * Remove FlagManager * Finalize Plot.java * Finalize PlotArea.java * Finalize PlotListener * Fix API issues * Fix a bunch of compile errors * Fix `/plot flag remove` * Fix initialization of GlobalFlagContainer * Apply API changes to events * Update SQLManager to new API * Invert default value for DenyExitFlag * Replace flag.getValue().toString() with flag.toString() * Make FlagContainer instance in Plot final * Fix various command issues * Clean up PlotSettings * Don't show internal flags in flag list * Fix `/plot flag add` * Remove the info inventory as it's 100% broken * Add plot info entries and fix up the default format * Fix default flag state in Captions * 781c200 part 2 * Fix odd grammar in captions * Fix odd grammar in captions v2 * Add create table statements for plot_flags * Remove old flag references in SQLManager * Use the new plot_flags table * Add tab completion to `/plot flag` * Improve parse error handling * Make flag permission check recognize parse exceptions * Initial progress towards flag conversion * Fix minor issues * Don't validate flags during flag conversion * Allow unrecognized flags to be parsed * Filter out internal flags from command sugguestions * Use the wrong caption when there's no plot description set * Limit command suggestions for boolean flags * Make blocktypelistflags accept blockcategories * Require categories to be prefixed with '#' and fix some minor display issues * Fix plot database conversion * Update PlotFlagEvent.java Updated return description * Fix command annotation wrapping * Add FLAG_UPDATE event for FlagContainer listeners * Make getParentContainer nullable * Document castUnsafe in FlagContainer * Document FlagContainer constructors * Add missing documentation to FlagContainer * Document FlagParseException * Fix wording in FlagContainer javadoc * Document InternalFlag * Document PlotFlag * Minor changes * Remove revisit comments Co-authored-by: Hannes Greule <SirYwell@users.noreply.github.com> Co-authored-by: NotMyFault <mc.cache@web.de> Co-authored-by: Matt <4009945+MattBDev@users.noreply.github.com>
2020-02-24 18:42:02 +01:00
@Override public void setFlag(Plot plot, PlotFlag<?, ?> flag) {
}
@Override public void removeFlag(Plot plot, PlotFlag<?, ?> flag) {
2018-08-10 17:01:10 +02:00
}
2016-05-05 19:41:11 +02:00
2019-02-04 14:59:11 +01:00
@Override public void setClusterName(PlotCluster cluster, String name) {
2018-08-10 17:01:10 +02:00
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void setAlias(Plot plot, String alias) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void purgeIds(Set<Integer> uniqueIds) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void purge(PlotArea area, Set<PlotId> plotIds) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void setPosition(Plot plot, String position) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void setPosition(PlotCluster cluster, String position) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void removeTrusted(Plot plot, UUID uuid) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void removeHelper(PlotCluster cluster, UUID uuid) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void removeMember(Plot plot, UUID uuid) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void removeInvited(PlotCluster cluster, UUID uuid) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void setTrusted(Plot plot, UUID uuid) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void setHelper(PlotCluster cluster, UUID uuid) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void setMember(Plot plot, UUID uuid) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void setInvited(PlotCluster cluster, UUID uuid) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void removeDenied(Plot plot, UUID uuid) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void setDenied(Plot plot, UUID uuid) {
}
2016-05-05 19:41:11 +02:00
@Override public HashMap<UUID, Integer> getRatings(Plot plot) {
return null;
}
2018-08-10 17:01:10 +02:00
@Override public void setRating(Plot plot, UUID rater, int value) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void removeComment(Plot plot, PlotComment comment) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void clearInbox(Plot plot, String inbox) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void setComment(Plot plot, PlotComment comment) {
}
2016-05-05 19:41:11 +02:00
2019-09-08 20:02:45 +02:00
@Override public void getComments(@NotNull Plot plot, String inbox,
RunnableVal<List<PlotComment>> whenDone) {
2018-08-10 17:01:10 +02:00
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void createPlotAndSettings(Plot plot, Runnable whenDone) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void createCluster(PlotCluster cluster) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void resizeCluster(PlotCluster current, PlotId min, PlotId max) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void movePlot(Plot originalPlot, Plot newPlot) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void replaceUUID(UUID old, UUID now) {
}
2016-05-05 19:41:11 +02:00
@Override public boolean deleteTables() {
return false;
}
2018-08-10 17:01:10 +02:00
@Override public void close() {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void replaceWorld(String oldWorld, String newWorld, PlotId min, PlotId max) {
}
2016-05-05 19:41:11 +02:00
2018-08-10 17:01:10 +02:00
@Override public void updateTables(int[] oldVersion) {
}
2016-05-05 19:39:54 +02:00
}
2016-05-05 19:41:11 +02:00