// Path: src/main/java/io/pivotal/strepsirrhini/chaosloris/data/Chaos.java
// @Entity
// @Table(uniqueConstraints = @UniqueConstraint(columnNames = {"application_id", "schedule_id"}))
// public class Chaos {
// 
//     @JoinColumn(nullable = false)
//     @JsonIgnore
//     @ManyToOne
//     private Application application;
// 
//     @Column(nullable = false)
//     @GeneratedValue
//     @Id
//     @JsonIgnore
//     private Long id;
// 
//     @Column(nullable = false)
//     private Double probability;
// 
//     @JoinColumn(nullable = false)
//     @JsonIgnore
//     @ManyToOne
//     private Schedule schedule;
// 
//     /**
//      * Create a new instance
//      *
//      * @param application the application to apply chaos to
//      * @param probability the probability of an instance being destroyed
//      * @param schedule    the schedule to apply chaos on
//      */
//     public Chaos(Application application, Double probability, Schedule schedule) {
//         this.application = application;
//         this.probability = probability;
//         this.schedule = schedule;
//     }
// 
//     Chaos() {
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) {
//             return true;
//         }
//         if (o == null || getClass() != o.getClass()) {
//             return false;
//         }
//         Chaos chaos = (Chaos) o;
//         return Objects.equals(this.application, chaos.application) &&
//             Objects.equals(this.id, chaos.id) &&
//             Objects.equals(this.probability, chaos.probability) &&
//             Objects.equals(this.schedule, chaos.schedule);
//     }
// 
//     /**
//      * Returns the application
//      *
//      * @return the application
//      */
//     public Application getApplication() {
//         return this.application;
//     }
// 
//     /**
//      * Returns the id
//      *
//      * @return the id
//      */
//     public Long getId() {
//         return this.id;
//     }
// 
//     /**
//      * Sets the id
//      *
//      * @param id the id
//      */
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     /**
//      * Returns the probability
//      *
//      * @return the probability
//      */
//     public Double getProbability() {
//         return this.probability;
//     }
// 
//     /**
//      * Sets the probability
//      *
//      * @param probability the probability
//      */
//     public void setProbability(Double probability) {
//         this.probability = probability;
//     }
// 
//     /**
//      * Returns the schedule
//      *
//      * @return the schedule
//      */
//     public Schedule getSchedule() {
//         return this.schedule;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(this.application, this.id, this.probability, this.schedule);
//     }
// 
//     @Override
//     public String toString() {
//         return "Chaos{" +
//             "application=" + this.application +
//             ", id=" + this.id +
//             ", probability=" + this.probability +
//             ", schedule=" + this.schedule +
//             '}';
//     }
// 
// }
// 
// Path: src/main/java/io/pivotal/strepsirrhini/chaosloris/data/EventRepository.java
// @Repository
// public interface EventRepository extends JpaRepository<Event, Long> {
// 
//     /**
//      * Find all of the {@link Event}s related to a {@link Chaos}
//      *
//      * @param chaos the {@link Chaos} that {@link Event}s are related to
//      * @return a collection of {@link Event}s related to the {@link Chaos}
//      */
//     @Transactional(readOnly = true)
//     List<Event> findByChaos(Chaos chaos);
// 
//     /**
//      * Find all of the {@link Event}s that occurred before an {@link Instant}
//      *
//      * @param instant the {@link Instant} to find {@link Event}s before
//      * @return a collection {@link Event}s that occurred before the {@link Instant}
//      */
//     @Transactional(readOnly = true)
//     List<Event> findByExecutedAtBefore(Instant instant);
// 
// }


import io.pivotal.strepsirrhini.chaosloris.data.Chaos;
import io.pivotal.strepsirrhini.chaosloris.data.EventRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.Resource;
import org.springframework.hateoas.mvc.ResourceAssemblerSupport;
import org.springframework.stereotype.Component;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn;
/*
 * Copyright 2015-2018 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.pivotal.strepsirrhini.chaosloris.web;



@Component
public final class ChaosResourceAssembler extends ResourceAssemblerSupport<Chaos, ChaosResourceAssembler.ChaosResource> {

// Path: src/main/java/io/pivotal/strepsirrhini/chaosloris/data/Chaos.java
// @Entity
// @Table(uniqueConstraints = @UniqueConstraint(columnNames = {"application_id", "schedule_id"}))
// public class Chaos {
// 
//     @JoinColumn(nullable = false)
//     @JsonIgnore
//     @ManyToOne
//     private Application application;
// 
//     @Column(nullable = false)
//     @GeneratedValue
//     @Id
//     @JsonIgnore
//     private Long id;
// 
//     @Column(nullable = false)
//     private Double probability;
// 
//     @JoinColumn(nullable = false)
//     @JsonIgnore
//     @ManyToOne
//     private Schedule schedule;
// 
//     /**
//      * Create a new instance
//      *
//      * @param application the application to apply chaos to
//      * @param probability the probability of an instance being destroyed
//      * @param schedule    the schedule to apply chaos on
//      */
//     public Chaos(Application application, Double probability, Schedule schedule) {
//         this.application = application;
//         this.probability = probability;
//         this.schedule = schedule;
//     }
// 
//     Chaos() {
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) {
//             return true;
//         }
//         if (o == null || getClass() != o.getClass()) {
//             return false;
//         }
//         Chaos chaos = (Chaos) o;
//         return Objects.equals(this.application, chaos.application) &&
//             Objects.equals(this.id, chaos.id) &&
//             Objects.equals(this.probability, chaos.probability) &&
//             Objects.equals(this.schedule, chaos.schedule);
//     }
// 
//     /**
//      * Returns the application
//      *
//      * @return the application
//      */
//     public Application getApplication() {
//         return this.application;
//     }
// 
//     /**
//      * Returns the id
//      *
//      * @return the id
//      */
//     public Long getId() {
//         return this.id;
//     }
// 
//     /**
//      * Sets the id
//      *
//      * @param id the id
//      */
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     /**
//      * Returns the probability
//      *
//      * @return the probability
//      */
//     public Double getProbability() {
//         return this.probability;
//     }
// 
//     /**
//      * Sets the probability
//      *
//      * @param probability the probability
//      */
//     public void setProbability(Double probability) {
//         this.probability = probability;
//     }
// 
//     /**
//      * Returns the schedule
//      *
//      * @return the schedule
//      */
//     public Schedule getSchedule() {
//         return this.schedule;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(this.application, this.id, this.probability, this.schedule);
//     }
// 
//     @Override
//     public String toString() {
//         return "Chaos{" +
//             "application=" + this.application +
//             ", id=" + this.id +
//             ", probability=" + this.probability +
//             ", schedule=" + this.schedule +
//             '}';
//     }
// 
// }
// 
// Path: src/main/java/io/pivotal/strepsirrhini/chaosloris/data/EventRepository.java
// @Repository
// public interface EventRepository extends JpaRepository<Event, Long> {
// 
//     /**
//      * Find all of the {@link Event}s related to a {@link Chaos}
//      *
//      * @param chaos the {@link Chaos} that {@link Event}s are related to
//      * @return a collection of {@link Event}s related to the {@link Chaos}
//      */
//     @Transactional(readOnly = true)
//     List<Event> findByChaos(Chaos chaos);
// 
//     /**
//      * Find all of the {@link Event}s that occurred before an {@link Instant}
//      *
//      * @param instant the {@link Instant} to find {@link Event}s before
//      * @return a collection {@link Event}s that occurred before the {@link Instant}
//      */
//     @Transactional(readOnly = true)
//     List<Event> findByExecutedAtBefore(Instant instant);
// 
// }


// Path: src/main/java/io/pivotal/strepsirrhini/chaosloris/web/ChaosResourceAssembler.java
import io.pivotal.strepsirrhini.chaosloris.data.Chaos;
import io.pivotal.strepsirrhini.chaosloris.data.EventRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.Resource;
import org.springframework.hateoas.mvc.ResourceAssemblerSupport;
import org.springframework.stereotype.Component;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn;

/*
 * Copyright 2015-2018 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.pivotal.strepsirrhini.chaosloris.web;



@Component
public final class ChaosResourceAssembler extends ResourceAssemblerSupport<Chaos, ChaosResourceAssembler.ChaosResource> {

    private final EventRepository eventRepository;