Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

199 changes: 171 additions & 28 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 2 additions & 33 deletions src/main/java/org/launchcode/techjobs/oo/CoreCompetency.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,12 @@

import java.util.Objects;

public class CoreCompetency {
public class CoreCompetency extends JobField {

private int id;
private static int nextId = 1;
private String value;

public CoreCompetency() {
this.id = nextId;
nextId++;
}

public CoreCompetency(String value) {
this();
this.value = value;
}

// Custom toString, equals, and hashCode methods:

@Override
public String toString() {
return value;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof CoreCompetency)) return false;
CoreCompetency that = (CoreCompetency) o;
return id == that.id;
}

@Override
public int hashCode() {
return Objects.hash(id);
super(value);
}

// TODO: Use the "Generate" tool to add a getter and setter for the 'value' field but
// ONLY a getter for the 'id' field.

}
45 changes: 2 additions & 43 deletions src/main/java/org/launchcode/techjobs/oo/Employer.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,13 @@

import java.util.Objects;

public class Employer {
public class Employer extends JobField {

private int id;
private static int nextId = 1;
private String value;

public Employer() {
id = nextId;
nextId++;
}

public Employer(String value) {
this();
this.value = value;
}

// Custom toString, equals, and hashCode methods:

@Override
public String toString() {
return value;
}

@Override
public boolean equals(Object o) { // Two objects are equal if they have the same id.
if (this == o) return true;
if (!(o instanceof Employer)) return false;
Employer employer = (Employer) o;
return getId() == employer.getId();
super(value);
}

@Override
public int hashCode() {
return Objects.hash(getId());
}

// Getters and Setters:

public int getId() {
return id;
}

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

}
Loading