Skip to content

Commit

Permalink
Rename UkSoftwareDevelopmenCompany -> UkSoftwareDevelopmentCompany. C…
Browse files Browse the repository at this point in the history
…leaned up some JavaDocs.
  • Loading branch information
GCHQDeveloper42 committed Jan 25, 2024
1 parent 9e2abf9 commit 6fccd5d
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ public String toString() {
return "ParticipantDetails [participant=" + participant + ", roles=" + roles + "]";
}

/** TODO: Comment. */
/** A {@link Participant}. */
public final Participant participant;

/** TODO: Comment. */
/** A {@link Set} of {@link Role}s. */
public final Set<Role> roles;

/**
* Constructor.
*
* @param participant A {@link Participant}.
* @param roles A {@link Set} of {@link Role}.
* @param roles A {@link Set} of {@link Role}s.
*/
public ParticipantDetails(final Participant participant, final Set<Role> roles) {
this.participant = participant;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ public class MagmaCoreServiceQueries {
""";

/**
* TODO: Comment.
* Find by field value and class query.
*/
public static final String FIND_BY_FIELD_VALUE_AND_CLASS = """
PREFIX hqdm: <https://hqdmtop.github.io/hqdm#>
Expand Down
3 changes: 3 additions & 0 deletions model-extension-example/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* Example module for extension of MagmaCore HQDM classes.
*/
module uk.gov.gchq.magmacore.examples.extensions {
exports uk.gov.gchq.magmacore.examples.extensions.ext;
exports uk.gov.gchq.magmacore.examples.extensions.model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import uk.gov.gchq.magmacore.examples.extensions.model.Constants;
import uk.gov.gchq.magmacore.examples.extensions.model.UkLimitedCompanyImpl;
import uk.gov.gchq.magmacore.examples.extensions.model.UkSoftwareDevelopmenCompanyImpl;
import uk.gov.gchq.magmacore.examples.extensions.model.UkSoftwareDevelopmentCompanyImpl;
import uk.gov.gchq.magmacore.hqdm.extensions.ExtensionService;
import uk.gov.gchq.magmacore.hqdm.model.Thing;
import uk.gov.gchq.magmacore.hqdm.rdf.iri.IRI;
Expand All @@ -20,19 +20,17 @@ public class HqdmExtensionService implements ExtensionService {
public Thing createEntity(final String typeName, final IRI iri) {

// Check the type name and return an appropriate instance.
//
if (Constants.UK_LIMITED_COMPANY_TYPE_NAME.equals(typeName)) {
final var result = new UkLimitedCompanyImpl(iri);
result.addValue(RDFS.RDF_TYPE, Constants.UK_LIMITED_COMPANY_IRI);
return result;
} else if (Constants.UK_SOFTWARE_DEVELOPMENT_COMPANY_TYPE_NAME.equals(typeName)) {
final var result = new UkSoftwareDevelopmenCompanyImpl(iri);
final var result = new UkSoftwareDevelopmentCompanyImpl(iri);
result.addValue(RDFS.RDF_TYPE, Constants.UK_SOFTWARE_DEVELOPMENT_COMPANY_IRI);
return result;
}

// Or null if it's not a class from this extension package.
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import uk.gov.gchq.magmacore.examples.extensions.model.Constants;
import uk.gov.gchq.magmacore.examples.extensions.model.UkLimitedCompany;
import uk.gov.gchq.magmacore.examples.extensions.model.UkSoftwareDevelopmenCompany;
import uk.gov.gchq.magmacore.examples.extensions.model.UkSoftwareDevelopmentCompany;
import uk.gov.gchq.magmacore.hqdm.extensions.ExtensionService;
import uk.gov.gchq.magmacore.hqdm.extensions.ExtensionServiceProvider;
import uk.gov.gchq.magmacore.hqdm.model.Thing;
Expand All @@ -24,7 +24,7 @@ public ExtensionService createService(final Map<IRI, Class<? extends Thing>> map
// Register our extension IRIs and the corresponding interfaces.
//
map.put(Constants.UK_LIMITED_COMPANY_IRI, UkLimitedCompany.class);
map.put(Constants.UK_SOFTWARE_DEVELOPMENT_COMPANY_IRI, UkSoftwareDevelopmenCompany.class);
map.put(Constants.UK_SOFTWARE_DEVELOPMENT_COMPANY_IRI, UkSoftwareDevelopmentCompany.class);

// Create ane return the extension service.
return new HqdmExtensionService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
* Define some useful Constants.
*/
public interface Constants {
/** UK limited company type name. */
public static final String UK_LIMITED_COMPANY_TYPE_NAME = "uk_limited_company";

/** UK limited company IRI. */
public static final HqdmIri UK_LIMITED_COMPANY_IRI = new HqdmIri(HQDM.HQDM, UK_LIMITED_COMPANY_TYPE_NAME);

/** UK software development company type name. */
public static final String UK_SOFTWARE_DEVELOPMENT_COMPANY_TYPE_NAME = "uk_software_development_company";

/** UK software development company IRI. */
public static final HqdmIri UK_SOFTWARE_DEVELOPMENT_COMPANY_IRI =
new HqdmIri(HQDM.HQDM, UK_SOFTWARE_DEVELOPMENT_COMPANY_TYPE_NAME);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
*/
public class UkLimitedCompanyImpl extends HqdmObject implements UkLimitedCompany {

/**
* {@code UkLimitedCompany} constructor.
*
* @param id ID for the UkLimitedCompany.
*/
public UkLimitedCompanyImpl(final IRI id) {
super(id);
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
/**
* An HQDM Extension interface to add a new entity type to MagmaCore.
*/
public interface UkSoftwareDevelopmenCompany extends UkLimitedCompany {
public interface UkSoftwareDevelopmentCompany extends UkLimitedCompany {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package uk.gov.gchq.magmacore.examples.extensions.model;

import uk.gov.gchq.magmacore.hqdm.pojo.HqdmObject;
import uk.gov.gchq.magmacore.hqdm.rdf.iri.IRI;

/**
* An HQDM Extension class to add a new entity type to MagmaCore.
*/
public class UkSoftwareDevelopmentCompanyImpl extends HqdmObject implements UkLimitedCompany {

/**
* {@code UkSoftwareDevelopmentCompanyImpl} constructor.
*
* @param id ID for the {@code UkSoftwareDevelopmentCompany}.
*/
public UkSoftwareDevelopmentCompanyImpl(final IRI id) {
super(id);
}
}

0 comments on commit 6fccd5d

Please sign in to comment.