Skip to content

Instantly share code, notes, and snippets.

import javax.persistence.*;
@Entity
@Table(name = "apartment")
public class Apartment {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
public class Apartment {
private double district;
private String address;
private double square;
private int rooms;
private double price;
public Apartment(double area, String address, double square, int rooms, double price) {
this.district = area;
this.address = address;
package Lesson_9_10.Lesson_9.Task_1;
public interface Entity <ID> {
ID getID();
}
package Lesson_7_8.Lesson_7.Task_3;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
public class Filter {
static <T> List<T> filter(List<T> list, Predicate<T> predicate) {
List<T> tofilter = new ArrayList<>();
for (T elem : list) {
package Lesson_7_8.Lesson_7.Task_2;
public class ComparablePair<T extends Comparable<? super T>> {
private T t1;
private T t2;
public ComparablePair(T t1, T t2) {
this.t1 = t1;
this.t2 = t2;
}
@EnioRich
EnioRich / Max
Created September 29, 2018 10:34
package Lesson_7_8.Lesson_7.Task_1;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
public class Max {
static <T> T max(List<T> list, Comparator<T> comparator) {
list.sort(comparator);
return list.get(0);
@EnioRich
EnioRich / Baggae
Created September 23, 2018 20:50
AirlineTicket
package Lesson_5_6.Task1_AirlineTicket;
public class Baggage {
private int bagquant;
private double bagprice;
public Baggage(int bagquant, double bagprice) {
this.bagquant = bagquant;
this.bagprice = bagprice;
}
package Project_one;
abstract class BaseuserInfo {
public String name;
private String surname;
private String number;
public BaseuserInfo(String name, String surname, String number) {
this.name = name;
this.surname = surname;
package Lesson_3_4.Lesson_3_Task_2;
import java.util.Arrays;
public class HallForSession {
private int row;
private int place;
private int hallnumber;
private static String FREE = "Free";
private static String BOOKED = "Boked";
package Lesson_3_4.Lesson_3_Task_1;
public class AudioContent {
private byte [] content;
public AudioContent (byte[]content){
this.content = content;
}
public byte[] getContent(){