/** * Retrieves specific Project * * @return the project object or null if project was not found */ @Override public Project retrieveProject(final String name, final String variant, final String version) { updateProjectCache(); // will also call initProjectCache() for (Project project : projectCache) { if (project.getName().equalsIgnoreCase(name) && (variant != null ? variant.equals(project.getVariant()) : true) && project.getVersion().equalsIgnoreCase(version)) return project; } return null; }
private Record getProjectRecord(Project project) { Record projRec = PROJECT_SCHEMA.createRecord(); PROJECT_ID_COLUMN.storeValue(projRec, project.getID()); PROJECT_FINGERPRINT_COLUMN.storeValue(projRec, project.getFingerPrint()); PROJECT_NAME_COLUMN.storeValue(projRec, project.getName()); String projVariant = project.getVariant(); PROJECT_VARIANT_COLUMN.storeValue( projRec, projVariant != null ? projVariant : ""); // replace null by empty string! PROJECT_VERSION_COLUMN.storeValue(projRec, project.getVersion()); PROJECT_V1X_SCHEMA_VERSION_COLUMN.storeValue(projRec, project.getV1XSchemaVersion()); return projRec; }