This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
Gleb Koval 1fd3fa8907
All checks were successful
Test Workflow / Lint and test library (pull_request) Successful in 9m10s
Publish Workflow / Publish library (pull_request) Successful in 9m36s
Linting
2023-12-20 15:12:56 +00:00

9 lines
387 B
Kotlin

package filesystem
// Note sealed allows for simpler logic in FSCreator by guaranteeing FSFile and FSFolder are the only possible FSEntries
// (as we expect), and it also makes the class abstract as required.
sealed class FSEntry(val name: String)
class FSFile(name: String, val content: String) : FSEntry(name)
class FSFolder(name: String, val entries: List<FSEntry>) : FSEntry(name)