@Override public boolean isMatching(CubeId other) { if (other instanceof StarredCubeId) { return equals(other); } if (other instanceof ParallelizedCubeId) { String otherId = other.getId(); String starlessId = id.substring(0, id.length() - 1); return otherId.startsWith(starlessId); } return false; }
@Override public Cube<?> getCube(String id) { CubeId cubeId = CubeIdFactory.get().create(id); for (Map.Entry<CubeId, Cube<?>> cubeEntry : this.cubes.entrySet()) { CubeId internalCubeId = cubeEntry.getKey(); if (internalCubeId.isMatching(cubeId)) { return cubeEntry.getValue(); } } return null; }
@Override public Cube<?> getCube(String id) { CubeId cubeId = CubeIdFactory.get().create(id); for (Map.Entry<CubeId, Cube<?>> cubeEntry : this.cubes.entrySet()) { CubeId internalCubeId = cubeEntry.getKey(); if (internalCubeId.isMatching(cubeId)) { return cubeEntry.getValue(); } } return null; }
@Override public boolean isMatching(CubeId other) { if (other instanceof ParallelizedCubeId) { return equals(other); } if (other instanceof StarredCubeId) { String otherId = other.getId(); String otherStarlessId = otherId.substring(0, otherId.length() - 1); String uuidLessId = id.substring(0, id.lastIndexOf('_')); return uuidLessId.equals(otherStarlessId); } return false; }
@Override public boolean isMatching(CubeId other) { if (other instanceof StarredCubeId) { return equals(other); } if (other instanceof ParallelizedCubeId) { String otherId = other.getId(); String starlessId = id.substring(0, id.length() - 1); return otherId.startsWith(starlessId); } return false; }
@Override public boolean isMatching(CubeId other) { if (other instanceof ParallelizedCubeId) { return equals(other); } if (other instanceof StarredCubeId) { String otherId = other.getId(); String otherStarlessId = otherId.substring(0, otherId.length() - 1); String uuidLessId = id.substring(0, id.lastIndexOf('_')); return uuidLessId.equals(otherStarlessId); } return false; }